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

Method test_uniform

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

Source from the content-addressed store, hash-verified

1320 random.seed(self.seed)
1321
1322 def test_uniform(self):
1323 low = [0]
1324 high = [1]
1325 uniform = random.uniform
1326 desired = np.array([0.53283302478975902,
1327 0.53413660089041659,
1328 0.50955303552646702])
1329
1330 self.set_seed()
1331 actual = uniform(low * 3, high)
1332 assert_array_almost_equal(actual, desired, decimal=14)
1333
1334 self.set_seed()
1335 actual = uniform(low, high * 3)
1336 assert_array_almost_equal(actual, desired, decimal=14)
1337
1338 def test_normal(self):
1339 loc = [0]

Callers

nothing calls this directly

Calls 2

set_seedMethod · 0.95

Tested by

no test coverage detected