diff options
author | dhuard <dhuard@localhost> | 2009-03-09 16:12:57 +0000 |
---|---|---|
committer | dhuard <dhuard@localhost> | 2009-03-09 16:12:57 +0000 |
commit | 46b375c98bf489699d1de5f4d8a6910e0e1c8ad5 (patch) | |
tree | 4e5b8477db3f039b2eb4503a8d45e44d8c6dc72f /numpy/random/tests | |
parent | dd8299b40e9128b18abd7df1adb462f53bb2493a (diff) | |
download | numpy-46b375c98bf489699d1de5f4d8a6910e0e1c8ad5.tar.gz |
Applied Anand's patch fixing Ticket #986 regarding the domain of the Von Mises random variable generator. Regression test added.
Diffstat (limited to 'numpy/random/tests')
-rw-r--r-- | numpy/random/tests/test_random.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py index 8dae16fcb..9d3de27e2 100644 --- a/numpy/random/tests/test_random.py +++ b/numpy/random/tests/test_random.py @@ -15,6 +15,17 @@ class TestMultinomial(TestCase): assert np.all(-5 <= x) assert np.all(x < -1) +class TestVonMises(TestCase): + def test_output_domain(self): + """Make sure generated random variables are in [-pi, pi]. + + Regression test for ticket #986. + """ + for mu in np.linspace(-7., 7., 5): + r = random.mtrand.vonmises(mu,1,50) + assert np.all(r>-np.pi) and np.all(r<=np.pi) + + class TestSetState(TestCase): def setUp(self): |