-
Notifications
You must be signed in to change notification settings - Fork 0
/
draw.py
18 lines (12 loc) · 3.11 KB
/
draw.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import cromlech as cr
cr_input = "./input/trainticket_no_trans_cromlech.yaml"
cr_output = [[32, 33, 34, 35, 36, 37, '100028R', '100029R', '100030R', '100031N', '100032R', '100033R'], [8, 9, 10, 11, 12, '100122R', '100123R', '100124R', '100125R'], [65, 68, 70, '100068N', '100072N'], [95, '100062N', '100072N', '100075N', '100094N', '100095N'], [39, 40, '100072N'], [74, 78, '100081N', '100082N', '100083N', '100084N', '100085N'], [102, 103, 104, 105, 106, '100054P', '100055P', '100056P', '100057P', '100058P', '100059P', '100060P'], [15, 96, 97, 98, 100, 101, '100096R', '100097R', '100098P'], [75, 76, 77, 79, '100081R', '100082R', '100083R', '100084R', '100085R'], [1, 2, 3, 4, 5, 6, 7, '100000P', '100001P', '100002P', '100003P', '100004P', '100005P', '100006P', '100007P'], [13, 14, 16, 17, 54, 55, 56, 57, 59, 60, 63, 64, 67, 72, 73, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 112, 113, 114, 115, 116, 117, 118, 119, 121, '100008P', '100009P', '100010P', '100028P', '100029P', '100030P', '100031P', '100032P', '100033P', '100051P', '100052P', '100053P', '100061P', '100062P', '100063P', '100064P', '100065P', '100066P', '100067P', '100068P', '100069P', '100070P', '100071P', '100072P', '100073P', '100074P', '100075P', '100076P', '100077P', '100078P', '100079P', '100080P', '100081P', '100082P', '100083P', '100084P', '100085P', '100086P', '100087P', '100088P', '100089P', '100090P', '100091P', '100096P', '100097P', '100102P', '100103P', '100104P', '100105P', '100106P', '100107P', '100108P', '100109P', '100110P', '100111P', '100112P', '100113P', '100114P', '100115P', '100116P', '100117P', '100118P', '100119P', '100120P', '100121P', '100122P', '100123P', '100124P', '100125P'], [107, 108, 109, 110, 111, '100102N', '100103N', '100104N', '100105N'], [27, 28, 29, 30, 31, '100011R', '100014R', '100016R', '100017P', '100018P', '100019P', '100020P', '100021P', '100022P', '100023P', '100024P', '100025P', '100026P', '100027P'], [42, 44, 46, '100099P', '100100P', '100101P'], [91, 92, 93, 94, '100092P', '100093P', '100094P', '100095P'], [99, '100096N'], [0, '100005N', '100006N', '100007N'], [120, '100120N'], [41, 43, 45, 53, '100044P', '100045P', '100046P', '100047P', '100048P', '100049P', '100050P', '100089R', '100091N', '100099N', '100100N', '100101N'], [66, '100068N', '100074N'], [18, 19, 20, 21, 22, '100008N', '100009R', '100010N'], [69, 71, '100068N', '100069N'], [61, '100051N', '100052N', '100053N'], [122, 123, '100126P', '100127P', '100128P', '100129P', '100130P', '100131P', '100132P', '100133P', '100134P', '100135P', '100136P'], [38, 47, 48, 49, 50, 51, 52, '100034P', '100035P', '100036P', '100037P', '100038P', '100039P', '100040P', '100041P', '100042P', '100043P'], [58, 62, '100077R', '100078N', '100079N', '100080N'], [23, 24, 25, 26, '100011P', '100012P', '100013P', '100014P', '100015P', '100016P']]
cr.setup(cr_input)
result_only_nums = []
for m in cr_output:
ops = [x for x in m if isinstance(x, int)]
attrs = [x for x in m if isinstance(x, str)]
attrs_num = [int(x[:len(x) - 1]) for x in attrs]
result_only_nums.append(ops + attrs_num)
cr.elect_primary_replicas(result_only_nums)
cr.format_and_draw_final(cr_output, "test.html")