simplebench.reporters.rich_table.reporter.options.options module🔗

Reporter for benchmark results using Rich tables on the console.

class simplebench.reporters.rich_table.reporter.options.options.RichTableOptions(
virtual_width: int | None = None,
fields: Sequence[RichTableField] | None = None,
variation_cols_last: bool = False,
)[source]🔗

Bases: ReporterOptions

Class for holding Rich table reporter specific options in a Choice.

This class provides additional configuration options specific to the JSON reporter. It is accessed via the options attribute of a Choice instance.

Parameters:
  • virtual_width –

    The width of the Rich table output in characters when rendered to the filesystem or via callback. Must be between 80 and 1000 characters or None. If None, no width constraint is applied.

    The virtual width is used to determine how the table should be formatted when rendered to non-console outputs, such as files or callbacks. This allows for better control over the appearance of the table in different contexts.

  • fields –

    A tuple of Rich Table fields to include in the output. If none is specifically set, a predefined set of fields is used. The fields appear in the order specified in the sequence.

    If specified, all fields must be from the RichTableField enum.

    The default fields, in order, are:

  • variation_cols_last – Whether to place the variation columns (if any) at the end of the rows. Defaults to False - which places the variation columns at the start of the rows.

Raises:
  • SimpleBenchTypeError – If any parameter is of an invalid type.

  • SimpleBenchValueError – If virtual_width is not between 80 and 10000 characters when specified or if fields is an empty sequence.

Initialize RichTableOptions instance.

property fields: tuple[RichTableField, ...]🔗

Return the fields, in order, to include in the Rich table when rendering.

Returns:

A tuple of RichTableField enums representing the default fields.

property variation_cols_last: bool🔗

Return whether variation columns are placed at the end of the rows.

Returns:

True if variation columns are placed at the end, False if at the start.

property virtual_width: int | None🔗

Return the virtual width of the Rich table output.

The virtual width is used when rendered to the filesystem or via callback.

Returns:

The virtual width of the Rich table output in characters.