Ejemplo n.º 1
0
 def test_sampleHolesUniformly(self):
     ncols = 1144
     nrows = 1024
     bounds = [(64, ncols), (64, nrows)]
     expected = [xy_to_hn(x, y) for x,y in sampleUniformly(100, bounds)]
     all_xy = quadratic_expand([range(64, ncols), range(64, nrows)])
     all_holes = [xy_to_hn(x, y) for x, y in all_xy]
     samples = sampleHolesUniformly(100, all_holes)
     self.assertEqual(expected, samples)
Ejemplo n.º 2
0
 def test_hn_xy_converters(self):
     for x in range(64, 1024, 10):
         for y in range(64, 1144, 10):
             hn = xy_to_hn(x, y)
             ox, oy = hn_to_xy(hn)
             self.assertEqual(x, ox)
             self.assertEqual(y, oy)