Skip to content

Commit

Permalink
Merge pull request #271 from dyson-ai/feature/update_docstrings
Browse files Browse the repository at this point in the history
Feature/update docstrings
  • Loading branch information
blooop authored Nov 27, 2023
2 parents 62b7269 + c2cccda commit 85ded8b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions bencher/bench_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ 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,
Expand Down
7 changes: 5 additions & 2 deletions bencher/plotting/plot_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@


class VarRange:
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.
"""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:
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.
Expand Down Expand Up @@ -48,6 +49,8 @@ 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(),
Expand Down
2 changes: 2 additions & 0 deletions bencher/plt_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@


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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "holobench"
version = "0.3.13"
version = "0.3.14"

authors = [{ name = "Austin Gregg-Smith", email = "[email protected]" }]
description = "A package for benchmarking the performance of arbitrary functions"
Expand Down

0 comments on commit 85ded8b

Please sign in to comment.