Exemplo n.º 1
0
 def test_random_numpy_coordination(self):
     # Verify that multiple numpy generators can be seeded from
     # a single RandomGenerator without duplicating values (as
     # discussed in #12632).
     g = mut.RandomGenerator(123)
     rs1 = np.random.RandomState(seed=g())
     rs1.randint(100)  # discard one
     rs2 = np.random.RandomState(seed=g())
     self.assertNotEqual(rs1.randint(100), rs2.randint(100))
Exemplo n.º 2
0
 def test_random_generator(self):
     g1 = mut.RandomGenerator()
     self.assertEqual(g1(), 3499211612)
     g2 = mut.RandomGenerator(seed=10)
     self.assertEqual(g2(), 3312796937)