Exemple #1
0
 def check_range_multiple_random_shape(self, ranges):
     for min, max in ranges:
         for size in sizes:
             for i in range(replays):
                 with self.subTest():
                     r = Range(min, max)
                     rand = r.random(size)
                     self.assertEqual(rand.shape, (size, 1), 'Random wrong shape')
Exemple #2
0
 def check_range_multiple_random_range(self, ranges):
     for min, max in ranges:
         for size in sizes:
             for i in range(replays):
                 with self.subTest():
                     r = Range(min, max)
                     rand = r.random(size)
                     self.assertTrue(np.alltrue(min <= rand) and np.alltrue(rand <= max), 'Random not in range')
Exemple #3
0
 def _check_range_random_type(self, ranges, t):
     for min, max in ranges:
         for i in range(replays):
             with self.subTest():
                 r = Range(min, max)
                 self.assertIsInstance(r.random(), t, 'Random wrong type')
Exemple #4
0
 def _check_range_single_random_range(self, ranges):
     for min, max in ranges:
         for i in range(replays):
             with self.subTest():
                 r = Range(min, max)
                 self.assertTrue(min <= r.random() <= max, 'Random not in range')