bencher.results.holoview_results.surface_result
Classes
A class for creating 3D surface plots from benchmark results. |
Functions
|
Extract sorted x/y coordinate arrays and a 2D z grid from a DataArray. |
Module Contents
- bencher.results.holoview_results.surface_result._da_to_sorted_grid(da: xarray.DataArray, x_name: str, y_name: str)
Extract sorted x/y coordinate arrays and a 2D z grid from a DataArray.
Sorts the DataArray along both axes so the resulting grid has monotonically increasing x and y values, which plotly requires for correct surface rendering.
- class bencher.results.holoview_results.surface_result.SurfaceResult(bench_cfg: bencher.bench_cfg.BenchCfg)
Bases:
bencher.results.holoview_results.holoview_result.HoloviewResultA class for creating 3D surface plots from benchmark results.
This class provides methods to visualize benchmark data as 3D surface plots, which are useful for showing relationships between two input variables and a result variable. Surface plots can also display standard deviation bounds when benchmark runs include multiple repetitions.
- to_plot(result_var: param.Parameter | None = None, override: bool = True, **kwargs) panel.pane.Pane | None
Generates a 3D surface plot from benchmark data.
This is a convenience method that calls to_surface() with the same parameters.
- Parameters:
result_var (Parameter, optional) – The result variable to plot. If None, uses the default.
override (bool, optional) – Whether to override filter restrictions. Defaults to True.
**kwargs – Additional keyword arguments passed to the plot rendering.
- Returns:
- A panel containing the surface plot if data is appropriate,
otherwise returns filter match results.
- Return type:
pn.pane.Pane | None
- to_surface(result_var: param.Parameter | None = None, override: bool = True, target_dimension: int = 2, **kwargs) panel.pane.Pane | None
Generates a 3D surface plot from benchmark data.
This method applies filters to ensure the data is appropriate for a surface plot and then passes the filtered data to to_surface_ds for rendering.
- Parameters:
result_var (Parameter, optional) – The result variable to plot. If None, uses the default.
override (bool, optional) – Whether to override filter restrictions. Defaults to True.
target_dimension (int, optional) – The target dimensionality for data filtering. Defaults to 2.
**kwargs – Additional keyword arguments passed to the plot rendering.
- Returns:
- A panel containing the surface plot if data is appropriate,
otherwise returns filter match results.
- Return type:
pn.pane.Pane | None
- to_surface_ds(dataset: xarray.Dataset, result_var: param.Parameter, override: bool = True, alpha: float = 0.3, width: int = 600, height: int = 600) panel.panel | None
Creates a 3D surface plot from the provided dataset.
Uses plotly directly (like VolumeResult) to avoid HoloViews backend contamination issues while ensuring reliable 3D rendering. Coordinates are sorted to guarantee monotonic x/y grids for plotly.
- Parameters:
dataset (xr.Dataset) – The dataset containing benchmark results.
result_var (Parameter) – The result variable to plot.
override (bool, optional) – Whether to override filter restrictions. Defaults to True.
alpha (float, optional) – The transparency for std-dev surfaces. Defaults to 0.3.
width (int, optional) – Plot width in pixels. Defaults to 600.
height (int, optional) – Plot height in pixels. Defaults to 600.
- Returns:
- A panel containing the surface plot if data matches criteria,
otherwise returns filter match results.
- Return type:
pn.panel | None