diff --git a/src/mlbench/__init__.py b/src/mlbench/__init__.py index b970926..c6580ae 100644 --- a/src/mlbench/__init__.py +++ b/src/mlbench/__init__.py @@ -9,4 +9,4 @@ pass # TODO: This naming is unfortunate -from .core import Benchmark, benchmark, parametrize +from .core import Benchmark, Params, benchmark, parametrize diff --git a/src/mlbench/core.py b/src/mlbench/core.py index ce9645d..f6706cc 100644 --- a/src/mlbench/core.py +++ b/src/mlbench/core.py @@ -10,6 +10,20 @@ def NoOp(**kwargs: Any) -> None: pass +# TODO: Should this be frozen (since the setUp and tearDown hooks are empty returns)? +@dataclass(init=False) +class Params: + """ + A dataclass designed to hold benchmark parameters. This class is not functional + on its own, and needs to be subclassed according to your benchmarking workloads. + + The main advantage over passing parameters as a dictionary is, of course, + static analysis and type safety for your benchmarking code. + """ + + pass + + @dataclass(frozen=True) class Benchmark: """