ebilab.api

実験を定義するためのAPIを提供します。

Classes

BaseExperiment

class ebilab.api.BaseExperiment(options)[source]

Bases: object

Inherit this class to define an experiment.

async cleanup()[source]

Override this method to define the cleanup steps.

columns: list[str] = []
name: str = 'experiment'
classmethod register_plotter(plotter_class: type[BasePlotter]) type[BasePlotter][source]

decorator to register a plotter class

async setup()[source]

Override this method to initialize the experiment.

async steps()[source]

Override this method to define the experiment steps.

This can be either: - An async generator that yields data dictionaries - A regular async function (coroutine) that doesn’t yield anything

BasePlotter

class ebilab.api.BasePlotter[source]

Bases: object

可視化ロジックを定義するための基底クラス。

name

プロッターの表示名

Type:

str

window_length

表示対象のデータ長(末尾から何行分を update() に渡すか)。 None の場合は全履歴を渡す。

Type:

int | None

get_window_length() int | None[source]

Override to dynamically set window_length.

Returns:

window_length value. Default returns self.window_length.

Return type:

int | None

name: str = 'Unnamed Plotter'
setup()[source]

プロットの初期設定を行う。プロットがアクティブになった際に一度だけ呼ばれる。

update(df: DataFrame)[source]

新しいデータを受け取り、プロットを更新する。

Parameters:

df – 実験データのDataFrame。

window_length: int | None = None

Field Classes

パラメータを定義するためのフィールドクラスです。

class ebilab.api.FloatField(default: 'float', max: 'float | None' = None, min: 'float | None' = None)[source]
default: float
max: float | None = None
min: float | None = None
class ebilab.api.IntField(default: 'int', max: 'int | None' = None, min: 'int | None' = None)[source]
default: int
max: int | None = None
min: int | None = None
class ebilab.api.StrField(default: 'str', allow_blank: 'bool' = False)[source]
allow_blank: bool = False
default: str
class ebilab.api.BoolField(default: 'bool' = False)[source]
default: bool = False
class ebilab.api.SelectField(choices: 'list[Any]', default_index: 'int' = 0)[source]
choices: list[Any]
default_index: int = 0