diff options
author | Kevin Sheppard <kevin.k.sheppard@gmail.com> | 2018-12-14 15:47:25 +0000 |
---|---|---|
committer | Kevin Sheppard <kevin.k.sheppard@gmail.com> | 2018-12-14 15:47:25 +0000 |
commit | f879e4fafd5dec5a68d9ff060c250db0a9aa0c5c (patch) | |
tree | f50710ade7e6e32b1470c6e46236cf2fcf560894 /numpy/random/tests/test_random.py | |
parent | 2f231b3231b5c9ae5d95b23a27d141091706df0c (diff) | |
download | numpy-f879e4fafd5dec5a68d9ff060c250db0a9aa0c5c.tar.gz |
ENH: Cast covariance to double in random mvnormal
Cast the covariance in the multivariate normal to double
so that the interpretation of tol is cleaner.
closes #10839
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 d0bb92a73..d35d32886 100644 --- a/numpy/random/tests/test_random.py +++ b/numpy/random/tests/test_random.py @@ -712,6 +712,12 @@ class TestRandomDist(object): assert_raises(ValueError, np.random.multivariate_normal, mean, cov, check_valid='raise') + cov = np.array([[1, 0.1],[0.1, 1]], dtype=np.float32) + with suppress_warnings() as sup: + np.random.multivariate_normal(mean, cov) + w = sup.record(RuntimeWarning) + assert len(w) == 0 + def test_negative_binomial(self): np.random.seed(self.seed) actual = np.random.negative_binomial(n=100, p=.12345, size=(3, 2)) |