bencher.plugins.bench_data

Classes

CacheHandle

Plugin-accessible memoization surface. Bencher core supplies a concrete handle;

RunMeta

BenchData

Frozen value type handed to plot plugins. The stable public contract surface for

Module Contents

class bencher.plugins.bench_data.CacheHandle

Bases: Protocol

Plugin-accessible memoization surface. Bencher core supplies a concrete handle; plugins treat it as opaque key/value storage.

get(key: str) Any | None
set(key: str, value: Any) None
class bencher.plugins.bench_data.RunMeta
name: str = ''
timestamp: datetime.datetime
sweep_hash: str = ''
class bencher.plugins.bench_data.BenchData

Frozen value type handed to plot plugins. The stable public contract surface for plugin authors — internal bencher refactors must preserve this shape.

dataset: xarray.Dataset
input_vars: tuple = ()
result_vars: tuple = ()
plt_cnt_cfg: bencher.plotting.plt_cnt_cfg.PltCntCfg | None = None
run_meta: RunMeta
optimizer_study: Any | None = None
baseline_runs: tuple[BenchData, Ellipsis] = ()
cache: CacheHandle | None = None
legacy_result: Any | None = None
render_kwargs: dict
has(capability: str) bool

True when an optional context field is populated.

Used by PlotFilter.requires to gate plugins that need fields beyond dataset+vars.

with_changes(**kwargs) BenchData
classmethod fake(*, dataset: xarray.Dataset | None = None, input_vars: tuple = (), result_vars: tuple = (), plt_cnt_cfg: bencher.plotting.plt_cnt_cfg.PltCntCfg | None = None, **overrides) BenchData

Construct a minimal BenchData for plugin unit tests.

Defaults dataset to an empty xr.Dataset and plt_cnt_cfg to a zero-counted config so plugin authors can construct a usable handle in one line.