Exemple #1
0
 def flat_test_slow2(self):
     shape = (10, 11)
     area = (3, 3)
     fs = FlatStructure(shape, area)
     x1 = fs.get_distances_to_area_border()
     assert_allclose(x1[0, :], [0, 0, 0, 0, 1, 0, 0, 0, 0])
     assert_allclose(x1[10, :], [0, 0, 0, 0, 1, 0, 0, 0, 0])
Exemple #2
0
 def flat_test_slow3(self):
     shape = (10, 11)
     area = (4, 4)
     fs = FlatStructure(shape, area)
     y = fs.unrolled2multidim(fs.get_distances_to_area_border())
     first = y[0, 0, ...]
     assert_allclose(first,
                     [[0., 0., 0., 0., 0.],
                      [0., 1., 1., 1., 0.],
                     [0., 1., 2., 1., 0.],
                      [0., 1., 1., 1., 0.],
                      [0., 0., 0., 0., 0.]])