-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
executable file
·141 lines (134 loc) · 2.43 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/usr/bin/env python3
import argparse
import pandas as pd
from pandas.io.json import json_normalize
from parse import parse_file
import json
from datetime import timedelta
pd.set_option("display.max_rows", None)
argparser = argparse.ArgumentParser(
description="Summarize c3lingo interpreter workloads"
)
argparser.add_argument(
"files",
nargs="+",
help="Path(s) to the file(s) to parse. Choose Etherpad's Plain Text export",
)
args = argparser.parse_args()
parsed = []
for path in args.files:
with open(path) as fp:
parsed += parse_file(fp.read())
data = json_normalize(
[shift.to_json() for talk in parsed for shift in talk.translation_shifts]
)
duration_by_translator = (
data.groupby(data.name.str.lower())["duration"]
.sum()
.sort_values(ascending=False)
)
print(duration_by_translator)
print()
print('Median:', duration_by_translator.median())
print(
'Translators with more than six hours:',
len(duration_by_translator[duration_by_translator > timedelta(hours=6)])
)
print(
'All translators:',
len(duration_by_translator),
)
people_with_shirts = ['Yann0u',
'ironic',
'Ben',
'eibwen',
'SimplySayM',
'sebalis',
'franzt',
'damok',
'remy_o',
'lemeda',
'Scriptkiddi',
'ningwie',
'tribut',
'MrBronze',
'waffle',
'DuckMan',
'sirenensang',
'Ludwig',
'Vassago',
'guillermo',
'joern',
'ToniHDS',
'KetieSaner',
'informancer',
'morkowka',
'yila',
'whitey_chan',
'os10000',
'db0',
'hnms',
'afrowson',
'korfuri',
'cami',
'genbi',
'phlo',
'dimir',
'Iggle',
'IconI',
'gooniesbro',
'kaste',
'MissSensei',
'comoelcometa',
'saltunza',
'shesapirate',
'kwiii',
'problame',
'pharmafirma',
'mary',
'max_eaxedx',
'snakey',
'LuKaRo',
'PetePriority',
'pinkdispatcher',
'bubbler',
'oskar',
'Aegy',
'sasha',
'breakthesystem',
'os10000',
'db0',
'hnms',
'afrowson',
'korfuri',
'cami',
'genbi',
'phlo',
'dimir',
'Iggle',
'IconI',
'gooniesbro',
'kaste',
'MissSensei',
'comoelcometa',
'saltunza',
'shesapirate',
'kwiii',
'problame',
'pharmafirma',
'mary',
'max_eaxedx',
'snakey',
'LuKaRo',
'PetePriority',
'pinkdispatcher',
'bubbler',
'oskar',
'Aegy',
'sasha',
'breakthesystem']
people_with_shirts = [name.lower() for name in people_with_shirts]
# print('Manual hours:')
manual_hours = duration_by_translator[[name not in people_with_shirts for name in duration_by_translator.index]] * 1.5
manual_hours = manual_hours.dt.ceil(freq='15min')
# print(manual_hours)