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

Method test_normal

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

Source from the content-addressed store, hash-verified

1079 assert_array_almost_equal(actual, desired, decimal=14)
1080
1081 def test_normal(self):
1082 loc = [0]
1083 scale = [1]
1084 bad_scale = [-1]
1085 normal = np.random.normal
1086 desired = np.array([2.2129019979039612,
1087 2.1283977976520019,
1088 1.8417114045748335])
1089
1090 self.setSeed()
1091 actual = normal(loc * 3, scale)
1092 assert_array_almost_equal(actual, desired, decimal=14)
1093 assert_raises(ValueError, normal, loc * 3, bad_scale)
1094
1095 self.setSeed()
1096 actual = normal(loc, scale * 3)
1097 assert_array_almost_equal(actual, desired, decimal=14)
1098 assert_raises(ValueError, normal, loc, bad_scale * 3)
1099
1100 def test_beta(self):
1101 a = [1]

Callers

nothing calls this directly

Calls 3

setSeedMethod · 0.95
assert_raisesFunction · 0.90

Tested by

no test coverage detected