Exemple #1
0
 def test_000110101(self):
     transitions = list(map(int, '000110101'))
     width = 8.0
     height = -1.2
     expected = [
         ((0, 0), (-4, -1.2)),
         ((-1, -0.9), (-2, -1.2)),
         ((-2, -0.6), (0, -1.2)),
         ((-1, -0.3), (2, -1.2)),
         ((0, 0), (4, -1.2)),
     ]
     actual = latex_trees_sr(transitions, width, height)
     check(expected, actual)
Exemple #2
0
 def test_001000111(self):
     transitions = list(map(int, '001000111'))
     width = 6.0
     height = -1.0
     expected = [
         ((0., 0.), (-3, -1)),
         ((-2.25, -0.75), (-1.5, -1)),
         ((1.5, -0.5), (0, -1)),
         ((2.25, -0.75), (1.5, -1)),
         ((0., 0.), (3, -1)),
     ]
     actual = latex_trees_sr(transitions, width, height)
     check(expected, actual)
Exemple #3
0
 def test_0000110001111(self):
     transitions = list(map(int, '0000110001111'))
     width = 6.0
     height = -1.0
     expected = [
         ((0, 0), (-3.0, -1.0)),
         ((0.5, -0.17), (-2.0, -1.0)),
         ((-0.5, -0.83), (-1.0, -1.0)),
         ((-1.0, -0.67), (0.0, -1.0)),
         ((2.0, -0.67), (1.0, -1.0)),
         ((2.5, -0.83), (2.0, -1.0)),
         ((0, 0), (3.0, -1.0)),
     ]
     actual = latex_trees_sr(transitions, width, height, verbose=True)
     check(expected, actual)
Exemple #4
0
 def test_0000101010111(self):
     transitions = list(map(int, '0000101010111'))
     width = 6.0
     height = -1.2
     expected = [
         ((0, 0), (-3, -1.2)),
         ((0.5, -0.2), (-2, -1.2)),
         ((1, -0.4), (-1, -1.2)),
         ((-0.5, -1), (0, -1.2)),
         ((0, -0.8), (1, -1.2)),
         ((0.5, -0.6), (2, -1.2)),
         ((0, 0), (3, -1.2)),
     ]
     actual = latex_trees_sr(transitions, width, height)
     check(expected, actual)