diff options
author | Allan Haldane <allan.haldane@gmail.com> | 2016-05-11 00:10:58 -0400 |
---|---|---|
committer | Allan Haldane <allan.haldane@gmail.com> | 2016-05-11 00:15:34 -0400 |
commit | a9465db4c70f9cd9c3fb9010229aadc7ec5fdc9c (patch) | |
tree | 9492b468c8a4809eebba0e877f763cda2d02c9d4 /numpy/lib/tests/test_function_base.py | |
parent | 3c394f7f8d09f08aaa068e617f79d542c17fd771 (diff) | |
download | numpy-a9465db4c70f9cd9c3fb9010229aadc7ec5fdc9c.tar.gz |
BUG: distance arg of np.gradient must be scalar, fix docstring
Fixups to docstring, and disallow non-scalars as the distance args to
np.gradient.
Fixes #7548, fixes #6847
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 34dfd5ecc..044279294 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -666,6 +666,9 @@ class TestGradient(TestCase): assert_raises(SyntaxError, gradient, x, np.array([1., 1.]), np.array([1., 1.]), np.array([1., 1.])) + # disallow arrays as distances, see gh-6847 + assert_raises(ValueError, gradient, np.arange(5), np.ones(5)) + def test_masked(self): # Make sure that gradient supports subclasses like masked arrays x = np.ma.array([[1, 1], [3, 4]], |