bencher.plotting.plot_filter ============================ .. py:module:: bencher.plotting.plot_filter Classes ------- .. autoapisummary:: bencher.plotting.plot_filter.VarRange bencher.plotting.plot_filter.PlotFilter bencher.plotting.plot_filter.PlotMatchesResult Module Contents --------------- .. py:class:: VarRange(lower_bound: int = 0, upper_bound: int = -1) A VarRange represents the bounded and unbounded ranges of integers. This class is used to define filters for various variable types. For example by defining cat_var = VarRange(0,0), calling matches(0) will return true, but any other integer will not match. You can also have unbounded ranges for example VarRange(2,None) will match to 2,3,4... up to infinity. for By default the lower and upper bounds are set to -1 so so that no matter what value is passed to matches() will return false. Matches only takes 0 and positive integers. .. py:attribute:: lower_bound :value: 0 .. py:attribute:: upper_bound :value: -1 .. py:method:: matches(val: int) -> bool Checks that a value is within the variable range. lower_bound and upper_bound are inclusive (lower_bound<=val<=upper_bound ) :param val: A positive integer representing a number of items :type val: int :returns: True if the items is within the range, False otherwise. :rtype: bool :raises ValueError: If val < 0 .. py:method:: matches_info(val: int, name: str) -> tuple[bool, str] Get matching info for a value with a descriptive name. :param val: A positive integer to check against the range :type val: int :param name: A descriptive name for the value being checked, used in the output string :type name: str :returns: A tuple containing: - bool: True if the value matches the range, False otherwise - str: A formatted string describing the match result :rtype: tuple[bool, str] .. py:method:: __str__() -> str .. py:class:: PlotFilter A class for representing the types of results a plot is able to represent. .. py:attribute:: float_range :type: VarRange .. py:attribute:: cat_range :type: VarRange .. py:attribute:: vector_len :type: VarRange .. py:attribute:: result_vars :type: VarRange .. py:attribute:: panel_range :type: VarRange .. py:attribute:: repeats_range :type: VarRange .. py:attribute:: input_range :type: VarRange .. py:method:: matches_result(plt_cnt_cfg: bencher.plotting.plt_cnt_cfg.PltCntCfg, plot_name: str, override: bool) -> PlotMatchesResult Checks if the result data signature matches the type of data the plot is able to display. :param plt_cnt_cfg: Configuration containing counts of different plot elements :type plt_cnt_cfg: PltCntCfg :param plot_name: Name of the plot being checked :type plot_name: str :param override: Whether to override filter matching rules :type override: bool :returns: Object containing match results and information :rtype: PlotMatchesResult .. py:class:: PlotMatchesResult(plot_filter: PlotFilter, plt_cnt_cfg: bencher.plotting.plt_cnt_cfg.PltCntCfg, plot_name: str, override: bool) Stores information about which properties match the requirements of a particular plotter .. py:attribute:: matches_info :type: str :value: '' .. py:attribute:: plt_cnt_cfg :type: bencher.plotting.plt_cnt_cfg.PltCntCfg .. py:method:: to_panel(**kwargs) -> panel.pane.Markdown | None Convert match information to a Panel Markdown pane if debug mode is enabled. :param \*\*kwargs: Additional keyword arguments to pass to the Panel Markdown constructor :returns: A Markdown pane containing match information if in debug mode, None otherwise :rtype: pn.pane.Markdown | None