repype.benchmark
- class repype.benchmark.Benchmark(filepath: PathLike)
-
Represents the benchmark data for a task.
- Parameters:
filepath – The path to the file where the benchmark data is persisted.
Example
>>> import tempfile >>> from repype.benchmark import Benchmark >>> >>> with tempfile.TemporaryDirectory() as tmp_path: ... benchmark = Benchmark[float](tmp_path + '/benchmark.csv') ... benchmark['stage1', 'input-1'] = 10 ... benchmark.save() ... del benchmark ... benchmark = Benchmark[float](tmp_path + '/benchmark.csv') ... print(benchmark['stage1', 'input-1']) ... 10.0
- __getitem__(where: Tuple[str, InputID]) ValueType
Get the benchmark value for a stage and an input.
- __setitem__(where: Tuple[str, InputID], value: ValueType) Self
Set the benchmark value for a stage and an input.
- df: DataFrame
The benchmark data dataframe.
- class repype.benchmark.ValueType
Represents the type of the benchmark values.
alias of TypeVar(‘ValueType’)