bencher.results.bench_result
Classes
Contains the results of the benchmark and has methods to cast the results to various datatypes and graphical representations |
Module Contents
- class bencher.results.bench_result.RerunResult
- class bencher.results.bench_result.BenchResult(bench_cfg)
Bases:
bencher.results.rerun_result.RerunResult,bencher.results.volume_result.VolumeResult,bencher.results.holoview_results.distribution_result.box_whisker_result.BoxWhiskerResult,bencher.results.holoview_results.distribution_result.violin_result.ViolinResult,bencher.results.holoview_results.distribution_result.scatter_jitter_result.ScatterJitterResult,bencher.results.holoview_results.scatter_result.ScatterResult,bencher.results.holoview_results.line_result.LineResult,bencher.results.holoview_results.bar_result.BarResult,bencher.results.holoview_results.heatmap_result.HeatmapResult,bencher.results.holoview_results.curve_result.CurveResult,bencher.results.holoview_results.band_result.BandResult,bencher.results.holoview_results.surface_result.SurfaceResult,bencher.results.histogram_result.HistogramResult,bencher.results.holoview_results.table_result.TableResult,bencher.results.holoview_results.tabulator_result.TabulatorResult,bencher.results.holoview_results.holoview_result.HoloviewResult,bencher.results.video_summary.VideoSummaryResult,bencher.results.dataset_result.DataSetResult,bencher.results.optuna_result.OptunaResultContains the results of the benchmark and has methods to cast the results to various datatypes and graphical representations
- timings = None
- classmethod from_existing(original: BenchResult) BenchResult
- to(result_type: BenchResult, result_var: param.Parameter | None = None, override: bool = True, reduce: bencher.results.bench_result_base.ReduceType | None = None, aggregate: bool | int | list[str] | None = None, agg_fn: Literal['mean', 'sum', 'max', 'min', 'median'] = 'mean', **kwargs: Any) BenchResult
Return the current instance of BenchResult.
- Returns:
The current instance of the benchmark result
- Return type:
- static default_plot_callbacks() list[callable]
Get the default list of plot callback functions.
These callbacks are used by default in the to_auto method if no specific plot list is provided.
- Returns:
A list of plotting callback functions
- Return type:
list[callable]
- static plotly_callbacks() list[callable]
Get the list of Plotly-specific callback functions.
- Returns:
A list of Plotly-based visualization callback functions
- Return type:
list[callable]
- plot() panel.panel
Plots the benchresult using the plot callbacks defined by the bench run.
This method uses the plot_callbacks defined in the bench_cfg to generate plots for the benchmark results.
- Returns:
A panel representation of the results, or None if no plot_callbacks defined
- Return type:
pn.panel
- to_bench_data(render_kwargs: dict | None = None) bencher.plugins.bench_data.BenchData
Snapshot this result as the frozen plugin data contract.
The transitional
legacy_result/render_kwargsfields carry the live result object and the plot kwargs for the wrapped built-in renderers; they disappear once renderers consume BenchData directly.- Returns:
The frozen data handle plot plugins receive.
- Return type:
- to_auto(plot_list: list[callable | str] | None = None, remove_plots: list[callable | str] | None = None, default_container=pn.Column, override: bool = False, numeric_only: bool = False, backend: str | None = None, **kwargs) list[panel.panel]
Automatically generate plots by dispatching through the plot plugin registry.
Every registered plugin whose match rule fits this sweep renders, in priority order — the built-in chart types (registered in
bencher.plugins.builtins) plus any user plugins registered withbencher.register_plugin/@bencher.plot_pluginor discovered via thebencher.plot_pluginsentry-point group.- Parameters:
plot_list (list[callable | str], optional) – Restrict to these plots. Entries are plugin names (“line”, “heatmap”, …) or, for backward compatibility, legacy plot callbacks (e.g.
LineResult.to_plot); unrecognized callables are invoked directly as before. Defaults to None (all matching plugins).remove_plots (list[callable | str], optional) – Plots to exclude, same entry forms as plot_list. Defaults to None.
default_container (type, optional) – Default container type for the plots. Defaults to pn.Column.
override (bool, optional) – Whether to override unsupported plots. Defaults to False.
numeric_only (bool, optional) – When True, skip the pane-type result plugin (images, videos, rerun, etc.) that cannot be numerically aggregated. Defaults to False.
backend (str, optional) – Preferred rendering backend. Chart types the preferred backend implements render through it; the rest keep their best other implementation. Defaults to None (highest priority wins).
**kwargs – Additional keyword arguments for plot configuration.
- Returns:
A list of panel objects containing the generated plots.
- Return type:
list[pn.panel]
- explain_selection(plot_list: list[callable | str] | None = None, remove_plots: list[callable | str] | None = None, numeric_only: bool = False, backend: str | None = None) str
Why each registered plugin would or wouldn’t render for this result.
Runs the same selection to_auto uses (same plot_list/remove_plots normalization) and renders the full decision table — chosen plugins first, each rejected one with the first gate that dropped it (named-only, missing capability, shape-filter mismatch, superseded backend, …).
- Returns:
A text table, one row per registered plugin.
- Return type:
str
- static _normalize_plot_list(plot_list: list[callable | str] | None) tuple[list[str] | None, list[callable]]
Split a to_auto plot_list into registry names and legacy callables.
Known callbacks translate to their plugin names; unknown callables keep working through the legacy direct-call path. None means “no restriction” (all registered plugins participate).
- static _plot_exclusions(remove_plots: list[callable | str] | None, extra_callbacks: list[callable], numeric_only: bool) tuple[set[str], list[callable]]
Compute the plugin names to exclude and drop removed legacy callables.
- to_auto_plots(extra_panels: collections.abc.Sequence[collections.abc.Callable[[BenchResult], panel.viewable.Viewable] | panel.viewable.Viewable] | None = None, **kwargs) panel.panel
Given the dataset result of a benchmark run, automatically deduce how to plot the data based on the types of variables that were sampled.
- Parameters:
extra_panels – Extra panel callables or static panels to inject after the sweep summary and before aggregate/auto plots. Each item is either a callable(BenchResult) -> panel, or a static panel object.
**kwargs – Additional keyword arguments for plot configuration.
- Returns:
A panel containing plot results.
- Return type:
pn.panel
- _scalar_aggregate_summary() panel.pane.Markdown
Render a Markdown table for a fully-aggregated (scalar) result.