bencher.results.holoview_results.distribution_result.distribution_result

Classes

DistributionResult

A base class for creating distribution plots (violin, box-whisker) from benchmark results.

Module Contents

class bencher.results.holoview_results.distribution_result.distribution_result.DistributionResult(bench_cfg: bencher.bench_cfg.BenchCfg)

Bases: bencher.results.holoview_results.holoview_result.HoloviewResult

A base class for creating distribution plots (violin, box-whisker) from benchmark results.

This class provides common functionality for various distribution plot types that show the distribution shape of the data. Child classes implement specific plot types (e.g., violin plots, box and whisker plots) but share filtering and data preparation logic.

Distribution plots are particularly useful for visualizing the statistical spread of benchmark metrics across different configurations, allowing for better understanding of performance variability.

to_distribution_plot(plot_method: Callable[[xarray.Dataset, param.Parameter, Any], holoviews.Element], result_var: param.Parameter | None = None, override: bool = True, **kwargs: Any) panel.panel | None

Generates a distribution plot from benchmark data.

This method applies filters to ensure the data is appropriate for distribution plots and then passes the filtered data to the specified plot method for rendering.

Parameters:
  • plot_method – The method to use for creating the specific plot type (e.g., violin, box-whisker)

  • result_var – The result variable to plot. If None, uses the default.

  • override – Whether to override filter restrictions. Defaults to True.

  • **kwargs – Additional keyword arguments passed to the plot rendering.

Returns:

A panel containing the plot if data is appropriate, otherwise returns filter match results.

static _build_distribution_overlay(df, plot_classes, kdims, var_name, result_var, title, **kwargs)

Build an hv.Overlay from one or more distribution plot classes.

_plot_distribution(dataset: xarray.Dataset, result_var: param.Parameter, plot_class: type[holoviews.Selection1DExpr], **kwargs: Any) holoviews.Element

Prepares data for distribution plots and creates the plot.

This method handles common operations needed for all distribution plot types, including converting data formats, setting up dimensions, and configuring plot aesthetics.

Parameters:
  • dataset – The dataset containing benchmark results.

  • result_var – The result variable to plot.

  • plot_class – The HoloViews plot class to use (e.g., hv.Violin, hv.BoxWhisker)

  • **kwargs – Additional keyword arguments for plot customization.

Returns:

A HoloViews Element representing the distribution plot.