simplebench.reporters.protocols packageπ
Protocols for reporters.
- class simplebench.reporters.protocols.ChoiceProtocol(*args, **kwargs)[source]π
Bases:
ProtocolA protocol defining the essential attributes for a Choice-like object.
This ensures that any object used within a generic
Choicescollection has the necessarynameandflagsattributes for indexing and management.
- class simplebench.reporters.protocols.ReportRenderer(*args, **kwargs)[source]π
Bases:
ProtocolA protocol for render methods in Reporters.
Defines a method signature for rendering benchmark results for a given
CaseandSection.The signature must match the following:
def method_name(self, *, case: Case, section: Section, options: ReporterOptions) -> str | bytes | Text | Table:
Subsets of
str | bytes | Text | Tablefor the return type are allowed for specific reporters.
- class simplebench.reporters.protocols.ReporterCallback(*args, **kwargs)[source]π
Bases:
ProtocolA protocol for callback functions used by Case and Reporters.
Defines a method signature for a reporter callback function.
The methodβs signature must match the following:
def method_name(self, *, case: Case, section: Section, output_format: Format, output: Any) -> None: