Creates box-plots of metrics.
(
ax: Axes,
file_key: Tuple[str, ...],
column_key: Tuple[str, ...],
row_key: Tuple[str, ...],
line_by: GroupingSpec,
metrics_df: pd.DataFrame,
metadata: Collection[BenchmarkMetadata],
)
| 69 | |
| 70 | @make_plotter |
| 71 | def metrics_box_plot( |
| 72 | ax: Axes, |
| 73 | file_key: Tuple[str, ...], |
| 74 | column_key: Tuple[str, ...], |
| 75 | row_key: Tuple[str, ...], |
| 76 | line_by: GroupingSpec, |
| 77 | metrics_df: pd.DataFrame, |
| 78 | metadata: Collection[BenchmarkMetadata], |
| 79 | ) -> None: |
| 80 | """ |
| 81 | Creates box-plots of metrics. |
| 82 | """ |
| 83 | assert GroupingKey.PLOTTER not in line_by.by |
| 84 | metric = _get_metric(metrics_df) |
| 85 | labels = [] |
| 86 | values = [] |
| 87 | for key, df, _ in group(metrics_df, [], metadata, line_by): |
| 88 | labels.append(_join_key(key)) |
| 89 | values.append(df.value) |
| 90 | # cf https://github.com/matplotlib/matplotlib/pull/27901 |
| 91 | label_id = "tick_labels" if Version(matplotlib.__version__) >= Version("3.9.0") else "labels" |
| 92 | ax.boxplot(values, **{label_id: labels}) # type: ignore[arg-type] |
| 93 | _shared_ax_config(ax, file_key, column_key, row_key, metric) |
| 94 | |
| 95 | |
| 96 | @make_plotter |
nothing calls this directly
no test coverage detected
searching dependent graphs…