From db0fdf0834911f1b5f0b55c40d1c1ea6fae0c10e Mon Sep 17 00:00:00 2001 From: Austin Gregg-Smith Date: Mon, 27 Nov 2023 18:44:53 +0000 Subject: [PATCH 1/4] [Add] docstrings for the main classes --- bencher/bench_runner.py | 1 + bencher/plotting/plot_filter.py | 5 +++-- bencher/plt_cfg.py | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bencher/bench_runner.py b/bencher/bench_runner.py index 212d54ce..5c5ff51e 100644 --- a/bencher/bench_runner.py +++ b/bencher/bench_runner.py @@ -13,6 +13,7 @@ def bench(self, run_cfg: BenchRunCfg, report: BenchReport) -> BenchCfg: class BenchRunner: + """A class to manage running multiple benchmarks in groups, or running the same benchmark but at multiple resolutions""" def __init__( self, name: str, diff --git a/bencher/plotting/plot_filter.py b/bencher/plotting/plot_filter.py index e7a1df2f..cf3a9902 100644 --- a/bencher/plotting/plot_filter.py +++ b/bencher/plotting/plot_filter.py @@ -7,9 +7,9 @@ class VarRange: + """A VarRange represents the bounded and unbounded ranges of integers. This class is used to define filters for various variable types. For example by defining cat_var = VarRange(0,0), calling matches(0) will return true, but any other integer will not match. You can also have unbounded ranges for example VarRange(2,None) will match to 2,3,4... up to infinity. for By default the lower and upper bounds are set to -1 so so that no matter what value is passsed to matches() will return false. Matches only takes 0 and positive integers.""" def __init__(self, lower_bound: int = 0, upper_bound: int = -1) -> None: - """A VarRange represents the bounded and unbounded ranges of integers. This class is used to define filters for various variable types. For example by defining cat_var = VarRange(0,0), calling matches(0) will return true, but any other integer will not match. You can also have unbounded ranges for example VarRange(2,None) will match to 2,3,4... up to infinity. for By default the lower and upper bounds are set to -1 so so that no matter what value is passsed to matches() will return false. Matches only takes 0 and positive integers. - + """ Args: lower_bound (int, optional): The smallest acceptable value to matches(). Passing None will result in a lower bound of 0 (as matches only accepts positive integers). Defaults to 0. upper_bound (int, optional): The largest acceptable value to matches(). Passing None will result in no upper bound. Defaults to -1. @@ -48,6 +48,7 @@ def __repr__(self) -> str: class PlotFilter: + """A class for representing the types of results a plot is able to represent.""" def __init__( self, float_range: VarRange = VarRange(), diff --git a/bencher/plt_cfg.py b/bencher/plt_cfg.py index a201b60a..4b133c93 100644 --- a/bencher/plt_cfg.py +++ b/bencher/plt_cfg.py @@ -14,6 +14,7 @@ class BenchPlotter: + """A deprecated class for handling benchmark plotting logic. Deprecation is still a work in progress""" @staticmethod def plot(bench_cfg: BenchCfg) -> List[pn.panel]: """Given the dataset result of a benchmark run, automatically dedeuce how to plot the data based on the types of variables that were sampled From 3aab246d15392de0d285cc26a04f53a6539d703a Mon Sep 17 00:00:00 2001 From: Austin Gregg-Smith Date: Mon, 27 Nov 2023 18:45:19 +0000 Subject: [PATCH 2/4] bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ac7926dd..38633f2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "holobench" -version = "0.3.10" +version = "0.3.11" authors = [{ name = "Austin Gregg-Smith", email = "blooop@gmail.com" }] description = "A package for benchmarking the performance of arbitrary functions" From eb48c5c2bfe2e0e65ef6a3c0028489bd5be8f967 Mon Sep 17 00:00:00 2001 From: Austin Gregg-Smith Date: Mon, 27 Nov 2023 18:52:22 +0000 Subject: [PATCH 3/4] autoformat --- bencher/bench_runner.py | 1 + bencher/plotting/plot_filter.py | 2 ++ bencher/plt_cfg.py | 1 + 3 files changed, 4 insertions(+) diff --git a/bencher/bench_runner.py b/bencher/bench_runner.py index 5c5ff51e..d29de6b0 100644 --- a/bencher/bench_runner.py +++ b/bencher/bench_runner.py @@ -14,6 +14,7 @@ def bench(self, run_cfg: BenchRunCfg, report: BenchReport) -> BenchCfg: class BenchRunner: """A class to manage running multiple benchmarks in groups, or running the same benchmark but at multiple resolutions""" + def __init__( self, name: str, diff --git a/bencher/plotting/plot_filter.py b/bencher/plotting/plot_filter.py index cf3a9902..42763d96 100644 --- a/bencher/plotting/plot_filter.py +++ b/bencher/plotting/plot_filter.py @@ -8,6 +8,7 @@ class VarRange: """A VarRange represents the bounded and unbounded ranges of integers. This class is used to define filters for various variable types. For example by defining cat_var = VarRange(0,0), calling matches(0) will return true, but any other integer will not match. You can also have unbounded ranges for example VarRange(2,None) will match to 2,3,4... up to infinity. for By default the lower and upper bounds are set to -1 so so that no matter what value is passsed to matches() will return false. Matches only takes 0 and positive integers.""" + def __init__(self, lower_bound: int = 0, upper_bound: int = -1) -> None: """ Args: @@ -49,6 +50,7 @@ def __repr__(self) -> str: class PlotFilter: """A class for representing the types of results a plot is able to represent.""" + def __init__( self, float_range: VarRange = VarRange(), diff --git a/bencher/plt_cfg.py b/bencher/plt_cfg.py index 4b133c93..86fa7e8f 100644 --- a/bencher/plt_cfg.py +++ b/bencher/plt_cfg.py @@ -15,6 +15,7 @@ class BenchPlotter: """A deprecated class for handling benchmark plotting logic. Deprecation is still a work in progress""" + @staticmethod def plot(bench_cfg: BenchCfg) -> List[pn.panel]: """Given the dataset result of a benchmark run, automatically dedeuce how to plot the data based on the types of variables that were sampled From c2cccdaaf2f86d37f2b9cd87b090835e753891fe Mon Sep 17 00:00:00 2001 From: Austin Gregg-Smith Date: Mon, 27 Nov 2023 21:09:56 +0000 Subject: [PATCH 4/4] increment version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5fc08bdd..ef2a33d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "holobench" -version = "0.3.13" +version = "0.3.14" authors = [{ name = "Austin Gregg-Smith", email = "blooop@gmail.com" }] description = "A package for benchmarking the performance of arbitrary functions"