- for idx in range(len(x_vals)):
- if not bool(int(idx % 2)):
- direction = "West-East"
- else:
- direction = "East-West"
- hovertext = ("No. of Runs: {nr}<br>"
- "Test: {test}<br>"
- "Direction: {dir}<br>".format(test=x_vals[idx],
- dir=direction,
- nr=nr_of_samples[idx]))
- if isinstance(y_maxs[idx], float):
- hovertext += "Max: {max:.2f}uSec<br>".format(max=y_maxs[idx])
- if isinstance(y_vals[idx], float):
- hovertext += "Mean: {avg:.2f}uSec<br>".format(avg=y_vals[idx])
- if isinstance(y_mins[idx], float):
- hovertext += "Min: {min:.2f}uSec".format(min=y_mins[idx])
-
- if isinstance(y_maxs[idx], float) and isinstance(y_vals[idx], float):
- array = [y_maxs[idx] - y_vals[idx], ]
- else:
- array = [None, ]
- if isinstance(y_mins[idx], float) and isinstance(y_vals[idx], float):
- arrayminus = [y_vals[idx] - y_mins[idx], ]
- else:
- arrayminus = [None, ]
- logging.debug("y_vals[{1}] :{0}\n".format(y_vals[idx], idx))
- logging.debug("array :{0}\n".format(array))
- logging.debug("arrayminus :{0}\n".format(arrayminus))
- traces.append(plgo.Scatter(
- x=[idx, ],
- y=[y_vals[idx], ],
- name=x_vals[idx],
- legendgroup=x_vals[idx],
- showlegend=bool(int(idx % 2)),
- mode="markers",
- error_y=dict(
- type='data',
- symmetric=False,
- array=array,
- arrayminus=arrayminus,
- color=COLORS[int(idx / 2)]
- ),
- marker=dict(
- size=10,
- color=COLORS[int(idx / 2)],
- ),
- text=hovertext,
- hoverinfo="text",
- ))
- annotations.append(dict(
- x=idx,
- y=0,
- xref="x",
- yref="y",
- xanchor="center",
- yanchor="top",
- text="E-W" if bool(int(idx % 2)) else "W-E",
- font=dict(
- size=16,
+ # Add plot traces
+ traces = list()
+ df_y = pd.DataFrame(y_vals)
+ df_y.head()
+ y_max = list()
+ for i, col in enumerate(df_y.columns):
+ tst_name = re.sub(REGEX_NIC, u"",
+ col.lower().replace(u'-ndrpdr', u'').
+ replace(u'2n1l-', u''))
+ kwargs = dict(
+ x=[str(i + 1) + u'.'] * len(df_y[col]),
+ y=[y / 1e6 if y else None for y in df_y[col]],
+ name=(
+ f"{i + 1}. "
+ f"({nr_of_samples[i]:02d} "
+ f"run{u's' if nr_of_samples[i] > 1 else u''}) "
+ f"{tst_name}"