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

Method test_standard_gamma

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

Source from the content-addressed store, hash-verified

1133 assert_raises(ValueError, exponential, bad_scale * 3)
1134
1135 def test_standard_gamma(self):
1136 shape = [1]
1137 bad_shape = [-1]
1138 std_gamma = np.random.standard_gamma
1139 desired = np.array([0.76106853658845242,
1140 0.76386282278691653,
1141 0.71243813125891797])
1142
1143 self.setSeed()
1144 actual = std_gamma(shape * 3)
1145 assert_array_almost_equal(actual, desired, decimal=14)
1146 assert_raises(ValueError, std_gamma, bad_shape * 3)
1147
1148 def test_gamma(self):
1149 shape = [1]

Callers

nothing calls this directly

Calls 3

setSeedMethod · 0.95
assert_raisesFunction · 0.90

Tested by

no test coverage detected