4 import matplotlib.pyplot
as plt
8 with open(filename,
"r")
as file:
9 reader = csv.reader(file, strict=
True)
12 converters = (str, int, int, int, float,
lambda x: float(x) * 1e-3)
15 if fieldnames
is None:
16 fieldnames = [n.strip()
for n
in row]
20 values.append([c(v)
for v, c
in zip(row, converters)])
22 request1 = values[: int(len(values) / 2)]
23 request2 = values[int(len(values) / 2) :]
26 while values[0][0:3] == values[Ntransforms][0:3]:
29 splitMethods = [
"avg",
"med",
"cen"]
35 BVs = sorted(list(set([v[0]
for v
in request1[::Ntransforms]])))
37 BVs.index(v[0]) + len(BVs) * v[2] + 3 * len(BVs) * v[1]
38 for v
in request1[::Ntransforms]
41 v[0] +
" " + type[v[1]] +
" " + splitMethods[v[2]]
for v
in request1[::Ntransforms]
44 idx_reorder = sorted(list(range(len(xvals))), key=
lambda i: xvals[i])
48 return [v[i]
for i
in idx_reorder]
57 for i
in range(Ntransforms):
61 reorder([v[5]
for v
in request1[i::Ntransforms]]),
67 reorder([v[5]
for v
in request2[i::Ntransforms]]),
73 plt.xticks(ticks=xvals_s, labels=cases_s, rotation=90)
74 plt.ylabel(
"Time (us)")
79 for k
in range(0, len(request1), Ntransforms):
83 xvals[int(k / Ntransforms)],
85 sum([v[5]
for v
in request1[k : k + Ntransforms]]) / Ntransforms,
89 xvals[int(k / Ntransforms)],
91 sum([v[5]
for v
in request2[k : k + Ntransforms]]) / Ntransforms,
98 sum([v[5]
for v
in request2[k : k + Ntransforms]]) / Ntransforms
99 for k
in range(0, len(request1), Ntransforms)
104 plt.xticks(ticks=xvals_s, labels=cases_s, rotation=90)
105 plt.ylabel(
"Time (us)")
110 for i
in range(Ntransforms):
111 if request2[i][3] > 0:
115 reorder([v[4]
for v
in request2[i::Ntransforms]]),
117 label=
str(i) +
"+lb",
121 plt.ylabel(
"Distance lower bound")
122 plt.xticks(ticks=xvals_s, labels=cases_s, rotation=90)