Skip to content

Commit 9871c01

Browse files
committed
Limit data in quality distribution
1 parent 418ae90 commit 9871c01

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

quality_distribution.py

+15-7
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,28 @@
1313

1414
def compute(values, out):
1515
res = list(sorted(map(lambda x: tuple(map(int, x.split(';'))), values.split('|')[:-1])))
16-
cum = [None] * len(res)
1716
total = sum(map(lambda x: x[1], res))
1817
running_total = 0
1918
out.write("err cum\n")
19+
goal = 1
2020
for i in range(len(res)):
21-
out.write(str(res[i][0]) + " " + str(float(total - running_total) / total) + "\n")
22-
cum[i] = float(total - running_total) / total
21+
curr = float(total - running_total) / total
22+
if curr <= goal:
23+
out.write(str(res[i][0]) + " " + str(float(total - running_total) / total) + "\n")
24+
goal -= 0.01
2325
running_total += res[i][1]
26+
# Consciously ignoring the last 1%
2427
out.write("\n")
2528

29+
done = { }
30+
2631
with open(file) as file:
2732
lines = csv.reader(file)
2833
for row in lines:
29-
with open(row[0] + "_rank_error.txt", "w") as out:
30-
compute(row[5], out)
31-
with open(row[0] + "_delay.txt", "w") as out:
32-
compute(row[5], out)
34+
# We have enough data as-is, only use a single testrun
35+
if row[0] not in done:
36+
with open(row[0] + "_rank_error.txt", "w") as out:
37+
compute(row[5], out)
38+
with open(row[0] + "_delay.txt", "w") as out:
39+
compute(row[9], out)
40+
done[row[0]] = None

0 commit comments

Comments
 (0)