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,
Bases:
objectImmutable, 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, andformatsparameters act as master lists, constraining the values that can be used within thechoicesanddefault_targetsparameters.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.- choicesπ
Defines the reporterβs command-line interface flags.
- Type:
- choices: ChoicesConfπ
A
ChoicesConfobject 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
targetsto use if not specified. Must be a subset of the maintargetsset.
- file_append: boolπ
If
True, append to the output file if it already exists. Mutually exclusive withfile_unique; exactly one must beTrue.
- 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 withfile_append; exactly one must beTrue.
- formats: frozenset[Format]π
The master set of
Formatenums this reporter can produce. This constrains the formats that can be used by anyChoiceConfin thechoiceslist.
- sections: frozenset[Section]π
The master set of
Sectionenums this reporter can handle. This constrains the sections that can be used by anyChoiceConfin thechoiceslist.
- 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
Targetenums this reporter can output to. This constrains the targets that can be used bydefault_targetsand anyChoiceConfin thechoiceslist.