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

Method test_random

numpy/random/tests/test_generator_mt19937.py:749–759  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

747 assert_equal(actual, desired)
748
749 def test_random(self):
750 random = Generator(MT19937(self.seed))
751 actual = random.random((3, 2))
752 desired = np.array([[0.096999199829214, 0.707517457682192],
753 [0.084364834598269, 0.767731206553125],
754 [0.665069021359413, 0.715487190596693]])
755 assert_array_almost_equal(actual, desired, decimal=15)
756
757 random = Generator(MT19937(self.seed))
758 actual = random.random()
759 assert_array_almost_equal(actual, desired[0, 0], decimal=15)
760
761 def test_random_float(self):
762 random = Generator(MT19937(self.seed))

Callers

nothing calls this directly

Calls 2

randomMethod · 0.80

Tested by

no test coverage detected