MCPcopy Create free account
hub / github.com/numpy/numpy / test_exponential

Method test_exponential

numpy/random/tests/test_random.py:1122–1133  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1120 assert_raises(ValueError, beta, a, bad_b * 3)
1121
1122 def test_exponential(self):
1123 scale = [1]
1124 bad_scale = [-1]
1125 exponential = np.random.exponential
1126 desired = np.array([0.76106853658845242,
1127 0.76386282278691653,
1128 0.71243813125891797])
1129
1130 self.setSeed()
1131 actual = exponential(scale * 3)
1132 assert_array_almost_equal(actual, desired, decimal=14)
1133 assert_raises(ValueError, exponential, bad_scale * 3)
1134
1135 def test_standard_gamma(self):
1136 shape = [1]

Callers

nothing calls this directly

Calls 3

setSeedMethod · 0.95
assert_raisesFunction · 0.90

Tested by

no test coverage detected