simplebench.reporters.graph.scatterplot package🔗

ScatterPlot graph.scatterplot sub-package in the reporters package.

class simplebench.reporters.graph.scatterplot.ScatterPlotConfig(
*,
name: str | None = None,
description: str | None = None,
sections: Iterable[Section] | None = None,
targets: Iterable[Target] | None = None,
default_targets: Iterable[Target] | None = None,
formats: Iterable[Format] | None = None,
choices: ChoicesConf | None = None,
file_suffix: str | None = None,
file_unique: bool | None = None,
file_append: bool | None = None,
subdir: str | None = None,
)[source]🔗

Bases: ReporterConfig

Configuration for a ScatterPlotReporter.

This class inherits from ReporterConfig and provides a type-safe, discoverable interface for overriding the default settings of a ScatterPlotReporter.

class simplebench.reporters.graph.scatterplot.ScatterPlotOptions(
width: int | None = None,
height: int | None = None,
dpi: int | None = None,
y_starts_at_zero: bool | None = None,
x_labels_rotation: float | None = None,
style: Style | None = None,
theme: Theme | None = None,
image_type: ImageType | None = None,
)[source]🔗

Bases: MatPlotLibOptions

Scatter Plot options.

Defaults are inherited from MatPlotLibOptions:

  • width: int = 1500

  • height: int = 750

  • dpi: int = 150

  • y_starts_at_zero: bool = True

  • x_labels_rotation: float = 45.0

  • style: Style = Style.DARK_BACKGROUND

  • theme: Theme = Theme.Default

  • image_type: ImageType = ImageType.SVG

class simplebench.reporters.graph.scatterplot.ScatterPlotReporter(
config: ScatterPlotConfig | None = None,
)[source]🔗

Bases: MatPlotLibReporter

Class for outputting benchmark results as scatter plot graphs.

This reporter generates scatter plot visualizations for various result sections, saving them to the filesystem or passing them to a callback function. It provides a visual way to compare the performance of different benchmark variations.

Defined command-line flags:

  • --scatter-plot: {filesystem, callback} (default=filesystem)

  • --scatter-plot.ops: ...

  • --scatter-plot.timings: ...

  • --scatter-plot.memory: ...

Example usage:

program.py --scatter-plot               # Outputs graphs to the filesystem.
program.py --scatter-plot.ops filesystem  # Outputs only ops graphs to the filesystem.
render(
*,
case: Case,
section: Section,
options: ReporterOptions,
) bytes[source]🔗

Render the scatter plot graph and return it as bytes.

Parameters:
  • case – The Case instance representing the benchmarked code.

  • section – The section of the results to plot.

  • options – The options for rendering the scatter plot.

Returns:

The rendered graph as bytes. The format is determined by the options. The defaults are defined in ScatterPlotOptions.

Raises:

Subpackages🔗

Submodules🔗