diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2014-05-29 16:30:59 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2014-05-29 16:30:59 -0600 |
commit | d1a2f7d92ff00d4e01e3a99124c76b99f561bfc9 (patch) | |
tree | a490e6475b6cd86519315d80aaac64f15478c4c3 /numpy/random/tests/test_random.py | |
parent | 3d14321fcec97501a20d3e9ade92abb7c3055c0e (diff) | |
parent | 69e26e54edd3c83fae61e880a102d1b979e2d67d (diff) | |
download | numpy-d1a2f7d92ff00d4e01e3a99124c76b99f561bfc9.tar.gz |
Merge pull request #4751 from juliantaylor/vonmises-fix
BUG: avoid infinite loop for small kappa in vonmises
Diffstat (limited to 'numpy/random/tests/test_random.py')
-rw-r--r-- | numpy/random/tests/test_random.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py index ef4e7b127..b64c9d6cd 100644 --- a/numpy/random/tests/test_random.py +++ b/numpy/random/tests/test_random.py @@ -629,6 +629,12 @@ class TestRandomDist(TestCase): [ 1.19153771588353052, 1.83509849681825354]]) np.testing.assert_array_almost_equal(actual, desired, decimal=15) + def test_vonmises_small(self): + # check infinite loop, gh-4720 + np.random.seed(self.seed) + r = np.random.vonmises(mu=0., kappa=1.1e-8, size=10**6) + np.testing.assert_(np.isfinite(r).all()) + def test_wald(self): np.random.seed(self.seed) actual = np.random.wald(mean = 1.23, scale = 1.54, size = (3, 2)) |