bencher.results.composable_container.composable_container_base ============================================================== .. py:module:: bencher.results.composable_container.composable_container_base Classes ------- .. autoapisummary:: bencher.results.composable_container.composable_container_base.ComposeType bencher.results.composable_container.composable_container_base.PaneLayout bencher.results.composable_container.composable_container_base.ComposableContainerBase Module Contents --------------- .. py:class:: ComposeType Bases: :py:obj:`strenum.StrEnum` StrEnum is a Python ``enum.Enum`` that inherits from ``str``. The default ``auto()`` behavior uses the member name as its value. Example usage:: class Example(StrEnum): UPPER_CASE = auto() lower_case = auto() MixedCase = auto() assert Example.UPPER_CASE == "UPPER_CASE" assert Example.lower_case == "lower_case" assert Example.MixedCase == "MixedCase" .. py:attribute:: right .. py:attribute:: down .. py:attribute:: sequence .. py:attribute:: overlay .. py:method:: flip() .. py:method:: from_horizontal(horizontal: bool) :staticmethod: .. py:class:: PaneLayout Bases: :py:obj:`strenum.StrEnum` Controls how multi-dimensional data is laid out in panel displays. grid: Use rows/columns for all dimensions (default, existing behavior) tabs: Use tabs for all outer dimensions, only the innermost uses grid tabs_and_grid: Use tabs for the outermost dimension, grid for inner dimensions .. py:attribute:: grid .. py:attribute:: tabs .. py:attribute:: tabs_and_grid .. py:method:: all() -> list[PaneLayout] :classmethod: Return all layout values. Use this instead of hard-coded name lists. .. py:class:: ComposableContainerBase A base class for renderer backends. A composable renderer .. py:attribute:: compose_method :type: ComposeType .. py:attribute:: container :type: list[Any] :value: [] .. py:attribute:: label_len :type: int :value: 0 .. py:method:: label_formatter(var_name: str, var_value: int | float | str) -> str :staticmethod: Take a variable name and values and return a pretty version with approximate fixed width :param var_name: The name of the variable, usually a dimension :type var_name: str :param var_value: The value of the dimension :type var_value: int | float | str :returns: Pretty string representation with fixed width :rtype: str .. py:method:: append(obj: Any) -> None Add an object to the container. The relationship between the objects is defined by the ComposeType :param obj: Object to add to the container :type obj: Any .. py:method:: render() Return a representation of the container that can be composed with other render() results. This function can also be used to defer layout and rending options until all the information about the container content is known. You may need to override this method depending on the container. See composable_container_video as an example. :returns: Visual representation of the container that can be combined with other containers :rtype: Any