diff options
author | Kevin Sheppard <kevin.k.sheppard@gmail.com> | 2019-02-18 12:29:02 +0000 |
---|---|---|
committer | Kevin Sheppard <kevin.k.sheppard@gmail.com> | 2019-02-18 12:51:25 +0000 |
commit | 61b3fa03b3bd4d05892646e13de35f00f577d786 (patch) | |
tree | 2f7bc6c436408586f2ef69f0488df688b97017b7 /numpy | |
parent | 5015d8785fc9bee27503de6db2ec44a12e3a2dbe (diff) | |
download | numpy-61b3fa03b3bd4d05892646e13de35f00f577d786.tar.gz |
DOC: Fix Wald docstring
Fix Wald Docstring to reflect actual restriction on parameters
Add a test to ensure these are enforced for scalar inputs
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/random/mtrand/mtrand.pyx | 4 | ||||
-rw-r--r-- | numpy/random/tests/test_random.py | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/numpy/random/mtrand/mtrand.pyx b/numpy/random/mtrand/mtrand.pyx index c5e4662d4..5f1039cb2 100644 --- a/numpy/random/mtrand/mtrand.pyx +++ b/numpy/random/mtrand/mtrand.pyx @@ -3530,9 +3530,9 @@ cdef class RandomState: Parameters ---------- mean : float or array_like of floats - Distribution mean, should be > 0. + Distribution mean, must be > 0. scale : float or array_like of floats - Scale parameter, should be >= 0. + Scale parameter, must be > 0. size : int or tuple of ints, optional Output shape. If the given shape is, e.g., ``(m, n, k)``, then ``m * n * k`` samples are drawn. If size is ``None`` (default), diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py index d4721bc62..656e38dc8 100644 --- a/numpy/random/tests/test_random.py +++ b/numpy/random/tests/test_random.py @@ -1354,6 +1354,8 @@ class TestBroadcast(object): assert_array_almost_equal(actual, desired, decimal=14) assert_raises(ValueError, wald, bad_mean, scale * 3) assert_raises(ValueError, wald, mean, bad_scale * 3) + assert_raises(ValueError, wald, 0.0, 1) + assert_raises(ValueError, wald, 0.5, 0.0) def test_triangular(self): left = [1] |