Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/update docstrings #271

Merged
merged 5 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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