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

Method test_standard_gamma

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

Source from the content-addressed store, hash-verified

1390 assert_raises(ValueError, exponential, bad_scale * 3)
1391
1392 def test_standard_gamma(self):
1393 shape = [1]
1394 bad_shape = [-1]
1395 std_gamma = random.standard_gamma
1396 desired = np.array([0.76106853658845242,
1397 0.76386282278691653,
1398 0.71243813125891797])
1399
1400 self.set_seed()
1401 actual = std_gamma(shape * 3)
1402 assert_array_almost_equal(actual, desired, decimal=14)
1403 assert_raises(ValueError, std_gamma, bad_shape * 3)
1404
1405 def test_gamma(self):
1406 shape = [1]

Callers

nothing calls this directly

Calls 3

set_seedMethod · 0.95
assert_raisesFunction · 0.90

Tested by

no test coverage detected