(self)
| 973 | assert_array_almost_equal(actual, desired, decimal=15) |
| 974 | |
| 975 | def test_uniform_range_bounds(self): |
| 976 | fmin = np.finfo('float').min |
| 977 | fmax = np.finfo('float').max |
| 978 | |
| 979 | func = np.random.uniform |
| 980 | assert_raises(OverflowError, func, -np.inf, 0) |
| 981 | assert_raises(OverflowError, func, 0, np.inf) |
| 982 | assert_raises(OverflowError, func, fmin, fmax) |
| 983 | assert_raises(OverflowError, func, [-np.inf], [0]) |
| 984 | assert_raises(OverflowError, func, [0], [np.inf]) |
| 985 | |
| 986 | # (fmax / 1e17) - fmin is within range, so this should not throw |
| 987 | # account for i386 extended precision DBL_MAX / 1e17 + DBL_MAX > |
| 988 | # DBL_MAX by increasing fmin a bit |
| 989 | np.random.uniform(low=np.nextafter(fmin, 1), high=fmax / 1e17) |
| 990 | |
| 991 | def test_scalar_exception_propagation(self): |
| 992 | # Tests that exceptions are correctly propagated in distributions |
nothing calls this directly
no test coverage detected