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

Method test_exponential

numpy/random/tests/test_randomstate.py:1379–1390  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1377 assert_raises(ValueError, beta, a, bad_b * 3)
1378
1379 def test_exponential(self):
1380 scale = [1]
1381 bad_scale = [-1]
1382 exponential = random.exponential
1383 desired = np.array([0.76106853658845242,
1384 0.76386282278691653,
1385 0.71243813125891797])
1386
1387 self.set_seed()
1388 actual = exponential(scale * 3)
1389 assert_array_almost_equal(actual, desired, decimal=14)
1390 assert_raises(ValueError, exponential, bad_scale * 3)
1391
1392 def test_standard_gamma(self):
1393 shape = [1]

Callers

nothing calls this directly

Calls 3

set_seedMethod · 0.95
assert_raisesFunction · 0.90

Tested by

no test coverage detected