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

Method test_normal

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

Source from the content-addressed store, hash-verified

1336 assert_array_almost_equal(actual, desired, decimal=14)
1337
1338 def test_normal(self):
1339 loc = [0]
1340 scale = [1]
1341 bad_scale = [-1]
1342 normal = random.normal
1343 desired = np.array([2.2129019979039612,
1344 2.1283977976520019,
1345 1.8417114045748335])
1346
1347 self.set_seed()
1348 actual = normal(loc * 3, scale)
1349 assert_array_almost_equal(actual, desired, decimal=14)
1350 assert_raises(ValueError, normal, loc * 3, bad_scale)
1351
1352 self.set_seed()
1353 actual = normal(loc, scale * 3)
1354 assert_array_almost_equal(actual, desired, decimal=14)
1355 assert_raises(ValueError, normal, loc, bad_scale * 3)
1356
1357 def test_beta(self):
1358 a = [1]

Callers

nothing calls this directly

Calls 3

set_seedMethod · 0.95
assert_raisesFunction · 0.90

Tested by

no test coverage detected