bencher.results.holoview_results.surface_result =============================================== .. py:module:: bencher.results.holoview_results.surface_result Classes ------- .. autoapisummary:: bencher.results.holoview_results.surface_result.SurfaceResult Functions --------- .. autoapisummary:: bencher.results.holoview_results.surface_result._da_to_sorted_grid Module Contents --------------- .. py:function:: _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. .. py:class:: SurfaceResult(bench_cfg: bencher.bench_cfg.BenchCfg) Bases: :py:obj:`bencher.results.holoview_results.holoview_result.HoloviewResult` A 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. .. py:method:: 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. :param result_var: The result variable to plot. If None, uses the default. :type result_var: Parameter, optional :param override: Whether to override filter restrictions. Defaults to True. :type override: bool, optional :param \*\*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. :rtype: pn.pane.Pane | None .. py:method:: 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. :param result_var: The result variable to plot. If None, uses the default. :type result_var: Parameter, optional :param override: Whether to override filter restrictions. Defaults to True. :type override: bool, optional :param target_dimension: The target dimensionality for data filtering. Defaults to 2. :type target_dimension: int, optional :param \*\*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. :rtype: pn.pane.Pane | None .. py:method:: 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. :param dataset: The dataset containing benchmark results. :type dataset: xr.Dataset :param result_var: The result variable to plot. :type result_var: Parameter :param override: Whether to override filter restrictions. Defaults to True. :type override: bool, optional :param alpha: The transparency for std-dev surfaces. Defaults to 0.3. :type alpha: float, optional :param width: Plot width in pixels. Defaults to 600. :type width: int, optional :param height: Plot height in pixels. Defaults to 600. :type height: int, optional :returns: A panel containing the surface plot if data matches criteria, otherwise returns filter match results. :rtype: pn.panel | None