bencher.plugins.registry

Attributes

ENTRY_POINT_GROUP

log

_REGISTRY

Classes

PluginRegistry

In-process registry of plot plugins, keyed by (name, backend).

Functions

_render_error_pane(→ panel.viewable.Viewable)

get_registry(→ PluginRegistry)

register_plugin(→ bencher.plugins.plugin.PlotPlugin)

unregister_plugin(→ None)

Module Contents

bencher.plugins.registry.ENTRY_POINT_GROUP = 'bencher.plot_plugins'
bencher.plugins.registry.log
bencher.plugins.registry._render_error_pane(plugin_name: str, exc: BaseException) panel.viewable.Viewable
class bencher.plugins.registry.PluginRegistry

In-process registry of plot plugins, keyed by (name, backend).

name is the chart type (“line”, “heatmap”, …); backend is the rendering library namespace (“holoviews”, “rerun”, …). Several backends may implement the same chart type; selection resolves each chart type to one implementation — the preferred backend when given, otherwise the highest-priority one. Registering an existing (name, backend) pair replaces it, which is the documented override mechanism (a user plugin replaces a built-in by sharing its name and backend, or outranks it from a different backend via priority/preference).

_plugins: dict[tuple[str, str], bencher.plugins.plugin.PlotPlugin]
_entry_points_loaded = False
register(plugin: bencher.plugins.plugin.PlotPlugin) None
unregister(name: str, backend: str | None = None) None

Remove a plugin. With no backend, removes every backend’s implementation of that chart type.

clear() None
mark_entry_points_loaded() None

Skip the entry-point scan on next lookup. Test-only helper.

get(name: str, backend: str | None = None) bencher.plugins.plugin.PlotPlugin | None

Resolve a chart type to one implementation.

With a backend, exact lookup. Without, the preferred implementation: highest priority among all backends providing name (ties broken by backend string for determinism).

implementations(name: str) tuple[bencher.plugins.plugin.PlotPlugin, Ellipsis]

Every backend’s implementation of a chart type, highest priority first.

all() tuple[bencher.plugins.plugin.PlotPlugin, Ellipsis]
_ensure_entry_points_loaded() None
_register_loaded(ep_name: str, obj) None
select(data: bencher.plugins.bench_data.BenchData, *, include: Iterable[str] | None = None, exclude: Iterable[str] | None = None, backend: str | None = None, only: str | None = None) tuple[bencher.plugins.plugin.PlotPlugin, Ellipsis]

Return one matching implementation per chart type, by descending priority.

  • only short-circuits to a single named chart type (no match-filter check; explicit opt-in by name implies the user knows what they want).

  • include / exclude filter the candidate set by chart-type name.

  • backend states the preferred backend: where a chart type is implemented by several backends, the preferred one is chosen when it matches; chart types the preferred backend does not provide still render through their best other implementation. This is what lets a config flag swap the rendering library under the same set of plotters.

render(data: bencher.plugins.bench_data.BenchData, *, include: Iterable[str] | None = None, exclude: Iterable[str] | None = None, backend: str | None = None, only: str | None = None, strict: bool = False) tuple[tuple[str, panel.viewable.Viewable], Ellipsis]

Run every selected plugin, returning (name, pane) pairs in priority order.

With strict=False (default) a render exception is caught and replaced with a visible error pane so one broken plugin doesn’t kill the report. strict=True re-raises the first failure — intended for development.

bencher.plugins.registry._REGISTRY
bencher.plugins.registry.get_registry() PluginRegistry
bencher.plugins.registry.register_plugin(plugin: bencher.plugins.plugin.PlotPlugin) bencher.plugins.plugin.PlotPlugin
bencher.plugins.registry.unregister_plugin(name: str, backend: str | None = None) None