Created
August 4, 2015 14:31
-
-
Save mvallebr/c4dfc3dd1c37c3f9188e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RunArgs = namedtuple("RunArgs", ["day", "low", "high", "idx", "num"]) | |
def build_run_args_map(): | |
args_per_day = """ | |
F 11265069 11420695 41 500000 | |
F 11420695 11563706 42 500000 | |
F 11563706 11644847 43 500000 | |
F 11644847 11723533 44 500000 | |
F 11723533 11797201 45 500000 | |
F 11797201 11868330 46 500000 | |
F 11868330 12000000 47 500000 | |
M 0 155837 1 500000 | |
M 1287322 1797820 5 500000 | |
M 155837 441497 2 500000 | |
M 1797820 2513264 6 500000 | |
M 2513264 3121232 7 500000 | |
M 3121232 3632442 8 500000 | |
M 3632442 4044613 9 500000 | |
M 4044613 4433809 10 500000 | |
M 441497 865932 3 500000 | |
M 865932 1287322 4 500000 | |
R 10024603 10208276 34 500000 | |
R 10208276 10418119 35 500000 | |
R 10418119 10586164 36 500000 | |
R 10586164 10753458 37 500000 | |
R 10753458 10882349 38 500000 | |
R 10882349 11084657 39 500000 | |
R 11084657 11265069 40 500000 | |
R 9324976 9515056 31 500000 | |
R 9515056 9803162 32 500000 | |
R 9803162 10024603 33 500000 | |
T 4433809 4789165 11 500000 | |
T 4789165 5106752 12 500000 | |
T 5106752 5392122 13 500000 | |
T 5392122 5664255 14 500000 | |
T 5664255 5944749 15 500000 | |
T 5944749 6243482 16 500000 | |
T 6243482 6501808 17 500000 | |
T 6501808 6738120 18 500000 | |
T 6738120 6956505 19 500000 | |
T 6956505 7184462 20 500000 | |
W 7184462 7387415 21 500000 | |
W 7387415 7605252 22 500000 | |
W 7605252 7814323 23 500000 | |
W 7814323 8013882 24 500000 | |
W 8013882 8206313 25 500000 | |
W 8206313 8411345 26 500000 | |
W 8411345 8639327 27 500000 | |
W 8639327 8865177 28 500000 | |
W 8865177 9091802 29 500000 | |
W 9091802 9324976 30 500000 | |
""" | |
result = defaultdict(list) | |
for line in args_per_day.split("\n"): | |
line = line.strip() | |
if len(line) == 0: | |
continue | |
args = line.split(" ") | |
result[args[0]].append(RunArgs(*args)) | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment