bencher.plugins.bench_data ========================== .. py:module:: bencher.plugins.bench_data Classes ------- .. autoapisummary:: bencher.plugins.bench_data.CacheHandle bencher.plugins.bench_data.RunMeta bencher.plugins.bench_data.BenchData Module Contents --------------- .. py:class:: CacheHandle Bases: :py:obj:`Protocol` Plugin-accessible memoization surface. Bencher core supplies a concrete handle; plugins treat it as opaque key/value storage. .. py:method:: get(key: str) -> Optional[Any] .. py:method:: set(key: str, value: Any) -> None .. py:class:: RunMeta .. py:attribute:: name :type: str :value: '' .. py:attribute:: timestamp :type: datetime.datetime .. py:attribute:: sweep_hash :type: str :value: '' .. py:class:: BenchData Frozen value type handed to plot plugins. The stable public contract surface for plugin authors — internal bencher refactors must preserve this shape. .. py:attribute:: dataset :type: xarray.Dataset .. py:attribute:: input_vars :type: tuple :value: () .. py:attribute:: result_vars :type: tuple :value: () .. py:attribute:: plt_cnt_cfg :type: Optional[bencher.plotting.plt_cnt_cfg.PltCntCfg] :value: None .. py:attribute:: run_meta :type: RunMeta .. py:attribute:: optimizer_study :type: Optional[Any] :value: None .. py:attribute:: baseline_runs :type: tuple[BenchData, Ellipsis] :value: () .. py:attribute:: cache :type: Optional[CacheHandle] :value: None .. py:attribute:: legacy_result :type: Optional[Any] :value: None .. py:attribute:: render_kwargs :type: dict .. py:method:: 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. .. py:method:: with_changes(**kwargs) -> BenchData .. py:method:: fake(*, dataset: Optional[xarray.Dataset] = None, input_vars: tuple = (), result_vars: tuple = (), plt_cnt_cfg: Optional[bencher.plotting.plt_cnt_cfg.PltCntCfg] = None, **overrides) -> BenchData :classmethod: 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.