simplebench.reporters.reporter.config moduleπŸ”—

Base reporter configuration class.

class simplebench.reporters.reporter.config.ReporterConfig(
*,
name: str,
description: str,
sections: frozenset[Section],
targets: frozenset[Target],
default_targets: frozenset[Target],
formats: frozenset[Format],
choices: ChoicesConf,
file_suffix: str,
file_unique: bool,
file_append: bool,
subdir: str,
)[source]πŸ”—

Bases: object

Immutable, attribute-based base configuration for a Reporter.

This frozen dataclass serves as the foundation for all specific reporter configuration classes (e.g., RichTableConfig). It defines the common data structure and centralizes the validation of all parameters required by reporters.

The sections, targets, and formats parameters act as master lists, constraining the values that can be used within the choices and default_targets parameters.

As a frozen dataclass, instances of this class are immutable; their state cannot be changed after creation. Validation and normalization of inputs are performed automatically in the __post_init__ method.

nameπŸ”—

The unique name for the reporter (e.g., β€˜rich-table’).

Type:

str

descriptionπŸ”—

A short description of what the reporter does.

Type:

str

sectionsπŸ”—

The master set of sections this reporter can handle.

Type:

frozenset[Section]

targetsπŸ”—

The master set of targets this reporter can output to.

Type:

frozenset[Target]

default_targetsπŸ”—

The default subset of targets to use.

Type:

frozenset[Target]

formatsπŸ”—

The master set of formats this reporter can produce.

Type:

frozenset[Format]

choicesπŸ”—

Defines the reporter’s command-line interface flags.

Type:

ChoicesConf

file_suffixπŸ”—

The file extension for filesystem targets, without the leading dot.

Type:

str

file_uniqueπŸ”—

If True, generate a unique filename for each output.

Type:

bool

file_appendπŸ”—

If True, append to the output file if it already exists.

Type:

bool

subdirπŸ”—

The subdirectory for saved files; '' means the root results directory.

Type:

str

choices: ChoicesConfπŸ”—

A ChoicesConf object defining the reporter’s command-line interface flags. These flags allow end-users to precisely control report generation by specifying which sections to include, what output format to use, and where to send the report (targets). They can also control other reporter-specific options.

default_targets: frozenset[Target]πŸ”—

The default subset of targets to use if not specified. Must be a subset of the main targets set.

description: strπŸ”—

A short description of what the reporter does. Cannot be empty or blank.

file_append: boolπŸ”—

If True, append to the output file if it already exists. Mutually exclusive with file_unique; exactly one must be True.

file_suffix: strπŸ”—

The file extension to use for filesystem targets (e.g., β€˜txt’), without the leading dot.

The suffix must consist only of alphanumeric characters and be 10 characters or less in length.

file_unique: boolπŸ”—

If True, generate a unique filename for each output. Mutually exclusive with file_append; exactly one must be True.

formats: frozenset[Format]πŸ”—

The master set of Format enums this reporter can produce. This constrains the formats that can be used by any ChoiceConf in the choices list.

name: strπŸ”—

The unique name for the reporter (e.g., β€˜rich-table’). Cannot be empty or blank.

sections: frozenset[Section]πŸ”—

The master set of Section enums this reporter can handle. This constrains the sections that can be used by any ChoiceConf in the choices list.

subdir: strπŸ”—

The subdirectory within the results directory to save files to. An empty string ('') specifies the root of the results directory (i.e., no subdirectory).

A subdirectory path should only contain valid directory name elements separated by forward slashes ('/'). Each element must consist only of alphanumeric, underscore, or dash characters, cannot be longer than 64 characters and cannot start or end with a dash or underscore.

Empty elements (i.e., consecutive slashes) are not allowed. Paths cannot start or end with a slash.

The total length of the subdirectory path must not exceed 255 characters.

targets: frozenset[Target]πŸ”—

The master set of Target enums this reporter can output to. This constrains the targets that can be used by default_targets and any ChoiceConf in the choices list.