Skip to content

Commit

Permalink
rename function to capture_rerun_winow
Browse files Browse the repository at this point in the history
  • Loading branch information
blooop committed Nov 24, 2024
1 parent 1dfb86a commit 1fcb77a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bencher/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
publish_file,
github_content,
)
from .utils_rerun import publish_and_view_rrd, rrd_to_pane, record_rerun_session
from .utils_rerun import publish_and_view_rrd, rrd_to_pane, capture_rerun_window

from .plotting.plot_filter import VarRange, PlotFilter
from .variables.parametrised_sweep import ParametrizedSweep
Expand Down
10 changes: 7 additions & 3 deletions bencher/example/example_rerun.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@


class SweepRerun(bch.ParametrizedSweep):
theta = bch.FloatSweep(default=1, bounds=[1, 4], doc="Input angle", units="rad", samples=30)
theta = bch.FloatSweep(
default=1, bounds=[1, 4], doc="Input angle", units="rad", samples=30
)

out_pane = bch.ResultContainer()

def __call__(self, **kwargs):
self.update_params_from_kwargs(**kwargs)
self.out_pane = bch.record_rerun_session(width=300,height=300)
self.out_pane = bch.capture_rerun_window(width=300, height=300)
rr.log("s1", rr.Boxes2D(half_sizes=[self.theta, 1]))

return super().__call__(**kwargs)


def example_rerun(run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None) -> bch.Bench:
def example_rerun(
run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None
) -> bch.Bench:
"""This example shows how to sample a 1 dimensional float variable and plot the result of passing that parameter sweep to the benchmarking function"""

bench = SweepRerun().to_bench(run_cfg, report)
Expand Down
2 changes: 1 addition & 1 deletion bencher/utils_rerun.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def publish_and_view_rrd(
return rrd_to_pane(publish_path, version=version)


def record_rerun_session(width: int = 500, height: int = 500):
def capture_rerun_window(width: int = 500, height: int = 500):
rrd_path = gen_rerun_data_path()
rr.save(rrd_path)
path = rrd_path.split("cachedir")[1]
Expand Down

0 comments on commit 1fcb77a

Please sign in to comment.