bencher.results.composable_container.composable_container_base

Classes

ComposeType

StrEnum is a Python enum.Enum that inherits from str. The default

PaneLayout

Controls how multi-dimensional data is laid out in panel displays.

ComposableContainerBase

A base class for renderer backends. A composable renderer

Module Contents

class bencher.results.composable_container.composable_container_base.ComposeType

Bases: 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"
right
down
sequence
overlay
flip()
static from_horizontal(horizontal: bool)
class bencher.results.composable_container.composable_container_base.PaneLayout

Bases: 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

grid
tabs
tabs_and_grid
classmethod all() list[PaneLayout]

Return all layout values. Use this instead of hard-coded name lists.

class bencher.results.composable_container.composable_container_base.ComposableContainerBase

A base class for renderer backends. A composable renderer

compose_method: ComposeType
container: list[Any] = []
label_len: int = 0
static label_formatter(var_name: str, var_value: int | float | str) str

Take a variable name and values and return a pretty version with approximate fixed width

Parameters:
  • var_name (str) – The name of the variable, usually a dimension

  • var_value (int | float | str) – The value of the dimension

Returns:

Pretty string representation with fixed width

Return type:

str

append(obj: Any) None

Add an object to the container. The relationship between the objects is defined by the ComposeType

Parameters:

obj (Any) – Object to add to the container

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

Return type:

Any