holobench 1.36.2__tar.gz → 1.38.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {holobench-1.36.2 → holobench-1.38.0}/PKG-INFO +12 -7
- {holobench-1.36.2 → holobench-1.38.0}/README.md +3 -2
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_all.py +2 -2
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_categorical.py +1 -1
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_custom_sweep.py +1 -1
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_docs.py +3 -3
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_float3D.py +1 -3
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_float_cat.py +1 -3
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_floats.py +1 -3
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_floats2D.py +1 -3
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_holosweep.py +1 -3
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_holosweep_objects.py +1 -3
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_holosweep_tap.py +2 -2
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_image.py +2 -4
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_levels.py +1 -3
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_pareto.py +1 -3
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_sample_cache.py +2 -2
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_simple_cat.py +1 -3
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_simple_float.py +4 -3
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_strings.py +1 -3
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_time_event.py +1 -1
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_video.py +2 -4
- holobench-1.38.0/bencher/example/inputs_0D/example_0_in_1_out.py +54 -0
- holobench-1.36.2/bencher/example/inputs_0D/example_0D.py → holobench-1.38.0/bencher/example/inputs_0D/example_0_in_2_out.py +9 -5
- holobench-1.38.0/bencher/example/inputs_1D/example1d_common.py +69 -0
- holobench-1.36.2/bencher/example/inputs_1D/example_1D.py → holobench-1.38.0/bencher/example/inputs_1D/example_1_in_1_out.py +26 -8
- holobench-1.38.0/bencher/example/inputs_1D/example_1_in_2_out.py +63 -0
- holobench-1.38.0/bencher/example/inputs_1D/example_1_in_2_out_repeats.py +61 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/meta/example_meta.py +5 -7
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/meta/example_meta_cat.py +1 -3
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/meta/example_meta_float.py +1 -1
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/meta/example_meta_levels.py +1 -1
- holobench-1.38.0/bencher/example/meta/generate_examples.py +54 -0
- holobench-1.38.0/bencher/example/meta/generate_meta.py +127 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/optuna/example_optuna.py +1 -3
- {holobench-1.36.2 → holobench-1.38.0}/bencher/job.py +4 -4
- {holobench-1.36.2 → holobench-1.38.0}/bencher/results/bench_result_base.py +5 -3
- {holobench-1.36.2 → holobench-1.38.0}/bencher/results/holoview_result.py +12 -4
- {holobench-1.36.2 → holobench-1.38.0}/bencher/variables/inputs.py +2 -4
- {holobench-1.36.2 → holobench-1.38.0}/pyproject.toml +31 -25
- holobench-1.38.0/resource/bencher +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/.gitignore +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/LICENSE +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/__init__.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/bench_cfg.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/bench_plot_server.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/bench_report.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/bench_runner.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/bencher.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/caching.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/class_enum.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/__init__.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/benchmark_data.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_composable_container.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_composable_container2.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_consts.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_custom_sweep2.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_dataframe.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_filepath.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_image1.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_levels2.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_publish.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_rerun.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_rerun2.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_sample_cache_context.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_simple.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_simple_bool.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_simple_float2d.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/example_workflow.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/experimental/example_bokeh_plotly.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/experimental/example_hover_ex.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/experimental/example_hvplot_explorer.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/experimental/example_interactive.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/experimental/example_streamnd.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/experimental/example_streams.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/experimental/example_template.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/experimental/example_updates.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/experimental/example_vector.py +0 -0
- {holobench-1.36.2/bencher/plotting → holobench-1.38.0/bencher/example/meta}/__init__.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/shelved/example_float2D_scatter.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/shelved/example_float3D_cone.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/example/shelved/example_kwargs.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/flask_server.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/optuna_conversions.py +0 -0
- {holobench-1.36.2/bencher/results → holobench-1.38.0/bencher/plotting}/__init__.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/plotting/plot_filter.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/plotting/plt_cnt_cfg.py +0 -0
- {holobench-1.36.2/bencher/results/composable_container → holobench-1.38.0/bencher/results}/__init__.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/results/bench_result.py +0 -0
- {holobench-1.36.2/bencher/variables → holobench-1.38.0/bencher/results/composable_container}/__init__.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/results/composable_container/composable_container_base.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/results/composable_container/composable_container_dataframe.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/results/composable_container/composable_container_panel.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/results/composable_container/composable_container_video.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/results/dataset_result.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/results/float_formatter.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/results/hvplot_result.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/results/optuna_result.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/results/panel_result.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/results/plotly_result.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/results/video_result.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/results/video_summary.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/utils.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/utils_rerun.py +0 -0
- /holobench-1.36.2/resource/bencher → /holobench-1.38.0/bencher/variables/__init__.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/variables/parametrised_sweep.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/variables/results.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/variables/sweep_base.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/variables/time.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/video_writer.py +0 -0
- {holobench-1.36.2 → holobench-1.38.0}/bencher/worker_job.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: holobench
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.38.0
|
4
4
|
Summary: A package for benchmarking the performance of arbitrary functions
|
5
5
|
Project-URL: Repository, https://github.com/dyson-ai/bencher
|
6
6
|
Project-URL: Home, https://github.com/dyson-ai/bencher
|
@@ -33,12 +33,16 @@ Requires-Dist: rerun-notebook; extra == 'rerun'
|
|
33
33
|
Requires-Dist: rerun-sdk==0.21.0; extra == 'rerun'
|
34
34
|
Provides-Extra: test
|
35
35
|
Requires-Dist: coverage<=7.6.10,>=7.5.4; extra == 'test'
|
36
|
-
Requires-Dist: hypothesis<=6.
|
37
|
-
Requires-Dist:
|
38
|
-
Requires-Dist:
|
36
|
+
Requires-Dist: hypothesis<=6.124.9,>=6.104.2; extra == 'test'
|
37
|
+
Requires-Dist: ipykernel; extra == 'test'
|
38
|
+
Requires-Dist: jupyter-bokeh; extra == 'test'
|
39
|
+
Requires-Dist: nbformat; extra == 'test'
|
40
|
+
Requires-Dist: pip; extra == 'test'
|
41
|
+
Requires-Dist: pre-commit<=4.1.0; extra == 'test'
|
42
|
+
Requires-Dist: pylint<=3.3.4,>=3.2.5; extra == 'test'
|
39
43
|
Requires-Dist: pytest-cov<=6.0.0,>=4.1; extra == 'test'
|
40
44
|
Requires-Dist: pytest<=8.3.4,>=7.4; extra == 'test'
|
41
|
-
Requires-Dist: ruff<=0.
|
45
|
+
Requires-Dist: ruff<=0.9.4,>=0.5.0; extra == 'test'
|
42
46
|
Description-Content-Type: text/markdown
|
43
47
|
|
44
48
|
# Bencher
|
@@ -105,7 +109,7 @@ pixi run demo
|
|
105
109
|
|
106
110
|
An example of the type of output bencher produces can be seen here:
|
107
111
|
|
108
|
-
https://
|
112
|
+
https://blooop.github.io/bencher/
|
109
113
|
|
110
114
|
|
111
115
|
## Examples
|
@@ -127,6 +131,7 @@ Start with example_simple_float.py and explore other examples based on your data
|
|
127
131
|
|
128
132
|
## Documentation
|
129
133
|
|
130
|
-
|
134
|
+
- [Examples Documentation](https://bencher.readthedocs.io/reference/index.html)
|
135
|
+
- [API documentation](https://bencher.readthedocs.io/autoapi/bencher/index.html)
|
131
136
|
|
132
137
|
More documentation is needed for the examples and general workflow.
|
@@ -62,7 +62,7 @@ pixi run demo
|
|
62
62
|
|
63
63
|
An example of the type of output bencher produces can be seen here:
|
64
64
|
|
65
|
-
https://
|
65
|
+
https://blooop.github.io/bencher/
|
66
66
|
|
67
67
|
|
68
68
|
## Examples
|
@@ -84,6 +84,7 @@ Start with example_simple_float.py and explore other examples based on your data
|
|
84
84
|
|
85
85
|
## Documentation
|
86
86
|
|
87
|
-
|
87
|
+
- [Examples Documentation](https://bencher.readthedocs.io/reference/index.html)
|
88
|
+
- [API documentation](https://bencher.readthedocs.io/autoapi/bencher/index.html)
|
88
89
|
|
89
90
|
More documentation is needed for the examples and general workflow.
|
@@ -5,7 +5,7 @@ from bencher.example.example_floats import example_floats
|
|
5
5
|
from bencher.example.example_floats2D import example_floats2D
|
6
6
|
from bencher.example.example_pareto import example_pareto
|
7
7
|
from bencher.example.example_simple_cat import example_1D_cat
|
8
|
-
from bencher.example.example_simple_float import
|
8
|
+
from bencher.example.example_simple_float import example_simple_float
|
9
9
|
from bencher.example.example_float_cat import example_float_cat
|
10
10
|
from bencher.example.example_time_event import example_time_event
|
11
11
|
from bencher.example.example_float3D import example_floats3D
|
@@ -30,7 +30,7 @@ if __name__ == "__main__":
|
|
30
30
|
bench_runner.add_run(example_floats2D)
|
31
31
|
bench_runner.add_run(example_floats3D)
|
32
32
|
bench_runner.add_run(example_1D_cat)
|
33
|
-
bench_runner.add_run(
|
33
|
+
bench_runner.add_run(example_simple_float)
|
34
34
|
bench_runner.add_run(example_pareto)
|
35
35
|
bench_runner.add_run(example_float_cat)
|
36
36
|
bench_runner.add_run(example_time_event)
|
@@ -7,7 +7,7 @@ from bencher.example.benchmark_data import ExampleBenchCfgIn, ExampleBenchCfgOut
|
|
7
7
|
|
8
8
|
|
9
9
|
def example_categorical(
|
10
|
-
run_cfg: bch.BenchRunCfg =
|
10
|
+
run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None
|
11
11
|
) -> bch.Bench:
|
12
12
|
"""Example of how to perform a categorical parameter sweep
|
13
13
|
|
@@ -21,7 +21,7 @@ class Square(bch.ParametrizedSweep):
|
|
21
21
|
|
22
22
|
|
23
23
|
def example_custom_sweep(
|
24
|
-
run_cfg: bch.BenchRunCfg =
|
24
|
+
run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None
|
25
25
|
) -> bch.Bench:
|
26
26
|
"""This example shows how to define a custom set of value to sample from instead of a uniform sweep
|
27
27
|
|
@@ -6,9 +6,9 @@ from bencher.example.meta.example_meta_cat import example_meta_cat
|
|
6
6
|
from bencher.example.meta.example_meta_float import example_meta_float
|
7
7
|
|
8
8
|
|
9
|
-
def example_docs(
|
10
|
-
|
11
|
-
|
9
|
+
def example_docs(run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None) -> bch.Bench:
|
10
|
+
if report is None:
|
11
|
+
report = bch.BenchReport()
|
12
12
|
# b_run = bch.BenchRunner("bench_runner_test", run_cfg=run_cfg)
|
13
13
|
# b_run.add_run(example_categorical)
|
14
14
|
# b_run.add_run(example_floats)
|
@@ -47,9 +47,7 @@ class VolumeSweep(bch.ParametrizedSweep):
|
|
47
47
|
return super().__call__()
|
48
48
|
|
49
49
|
|
50
|
-
def example_floats3D(
|
51
|
-
run_cfg: bch.BenchRunCfg = bch.BenchRunCfg(), report: bch.BenchReport = bch.BenchReport()
|
52
|
-
) -> bch.Bench:
|
50
|
+
def example_floats3D(run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None) -> bch.Bench:
|
53
51
|
"""Example of how to perform a 3D floating point parameter sweep
|
54
52
|
|
55
53
|
Args:
|
@@ -7,9 +7,7 @@ import bencher as bch
|
|
7
7
|
from bencher.example.benchmark_data import ExampleBenchCfgIn, ExampleBenchCfgOut, bench_function
|
8
8
|
|
9
9
|
|
10
|
-
def example_float_cat(
|
11
|
-
run_cfg: bch.BenchRunCfg = bch.BenchRunCfg(), report: bch.BenchReport = bch.BenchReport()
|
12
|
-
) -> bch.Bench:
|
10
|
+
def example_float_cat(run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None) -> bch.Bench:
|
13
11
|
"""Example of how to perform a parameter sweep for categorical variables
|
14
12
|
|
15
13
|
Args:
|
@@ -7,9 +7,7 @@ import bencher as bch
|
|
7
7
|
from bencher.example.benchmark_data import ExampleBenchCfgIn, ExampleBenchCfgOut, ExampleBenchCfg
|
8
8
|
|
9
9
|
|
10
|
-
def example_floats(
|
11
|
-
run_cfg: bch.BenchRunCfg = bch.BenchRunCfg(), report: bch.BenchReport = bch.BenchReport()
|
12
|
-
) -> bch.Bench:
|
10
|
+
def example_floats(run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None) -> bch.Bench:
|
13
11
|
"""Example of how to perform a parameter sweep for floating point variables
|
14
12
|
|
15
13
|
Args:
|
@@ -10,9 +10,7 @@ from bencher.example.benchmark_data import (
|
|
10
10
|
)
|
11
11
|
|
12
12
|
|
13
|
-
def example_floats2D(
|
14
|
-
run_cfg: bch.BenchRunCfg = bch.BenchRunCfg(), report: bch.BenchReport = bch.BenchReport()
|
15
|
-
) -> bch.Bench:
|
13
|
+
def example_floats2D(run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None) -> bch.Bench:
|
16
14
|
"""Example of how to perform a 2D floating point parameter sweep
|
17
15
|
|
18
16
|
Args:
|
@@ -69,9 +69,7 @@ class PlotFunctions(bch.ParametrizedSweep):
|
|
69
69
|
return None
|
70
70
|
|
71
71
|
|
72
|
-
def example_holosweep(
|
73
|
-
run_cfg: bch.BenchRunCfg = bch.BenchRunCfg(), report: bch.BenchReport = bch.BenchReport()
|
74
|
-
) -> bch.Bench:
|
72
|
+
def example_holosweep(run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None) -> bch.Bench:
|
75
73
|
bench = PlotFunctions().to_bench(run_cfg, report)
|
76
74
|
|
77
75
|
bench.plot_sweep(
|
@@ -73,9 +73,7 @@ def plot_holo(self, plot=True) -> hv.core.ViewableElement:
|
|
73
73
|
return None
|
74
74
|
|
75
75
|
|
76
|
-
def example_holosweep(
|
77
|
-
run_cfg: bch.BenchRunCfg = bch.BenchRunCfg(), report: bch.BenchReport = bch.BenchReport()
|
78
|
-
) -> bch.Bench:
|
76
|
+
def example_holosweep(run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None) -> bch.Bench:
|
79
77
|
# wv = PlotFunctions()
|
80
78
|
|
81
79
|
bench = bch.Bench(
|
@@ -79,7 +79,7 @@ class PlotFunctions(bch.ParametrizedSweep):
|
|
79
79
|
|
80
80
|
|
81
81
|
def example_holosweep_tap(
|
82
|
-
run_cfg: bch.BenchRunCfg =
|
82
|
+
run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None
|
83
83
|
) -> bch.Bench:
|
84
84
|
wv = PlotFunctions()
|
85
85
|
|
@@ -101,7 +101,7 @@ def example_holosweep_tap(
|
|
101
101
|
|
102
102
|
|
103
103
|
def example_holosweep_tap_slider(
|
104
|
-
run_cfg: bch.BenchRunCfg =
|
104
|
+
run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None
|
105
105
|
) -> bch.Bench: # pragma: no cover
|
106
106
|
wv = PlotFunctions()
|
107
107
|
|
@@ -55,9 +55,7 @@ class BenchPolygons(bch.ParametrizedSweep):
|
|
55
55
|
return filename
|
56
56
|
|
57
57
|
|
58
|
-
def example_image(
|
59
|
-
run_cfg: bch.BenchRunCfg = bch.BenchRunCfg(), report: bch.BenchReport = bch.BenchReport()
|
60
|
-
) -> bch.Bench:
|
58
|
+
def example_image(run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None) -> bch.Bench:
|
61
59
|
run_cfg.cache_results = False
|
62
60
|
bench = bch.Bench("polygons", BenchPolygons(), run_cfg=run_cfg, report=report)
|
63
61
|
|
@@ -131,7 +129,7 @@ if __name__ == "__main__":
|
|
131
129
|
return bench
|
132
130
|
|
133
131
|
def example_image_vid_sequential(
|
134
|
-
run_cfg: bch.BenchRunCfg =
|
132
|
+
run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None
|
135
133
|
) -> bch.Bench:
|
136
134
|
bench = BenchPolygons().to_bench(run_cfg, report)
|
137
135
|
bench.add_plot_callback(bch.BenchResult.to_title)
|
@@ -161,9 +161,7 @@ def run_levels_2D(bench: bch.Bench) -> bch.Bench:
|
|
161
161
|
return bench
|
162
162
|
|
163
163
|
|
164
|
-
def run_levels(
|
165
|
-
run_cfg: bch.BenchRunCfg = bch.BenchRunCfg(), report: bch.BenchReport = bch.BenchReport()
|
166
|
-
) -> bch.Bench:
|
164
|
+
def run_levels(run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None) -> bch.Bench:
|
167
165
|
hv.extension("bokeh")
|
168
166
|
opts.defaults(
|
169
167
|
opts.Curve(show_legend=False),
|
@@ -6,9 +6,7 @@ import bencher as bch
|
|
6
6
|
from bencher.example.benchmark_data import ExampleBenchCfgIn, ExampleBenchCfgOut, bench_function
|
7
7
|
|
8
8
|
|
9
|
-
def example_pareto(
|
10
|
-
run_cfg: bch.BenchRunCfg = bch.BenchRunCfg(), report: bch.BenchReport = bch.BenchReport()
|
11
|
-
) -> bch.Bench:
|
9
|
+
def example_pareto(run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None) -> bch.Bench:
|
12
10
|
"""Example of how to calculate the pareto front of a parameter sweep
|
13
11
|
|
14
12
|
Args:
|
@@ -27,8 +27,8 @@ class UnreliableClass(bch.ParametrizedSweep):
|
|
27
27
|
|
28
28
|
|
29
29
|
def example_sample_cache(
|
30
|
-
run_cfg: bch.BenchRunCfg =
|
31
|
-
report: bch.BenchReport =
|
30
|
+
run_cfg: bch.BenchRunCfg = None,
|
31
|
+
report: bch.BenchReport = None,
|
32
32
|
trigger_crash: bool = False,
|
33
33
|
) -> bch.Bench:
|
34
34
|
"""This example shows how to use the cache_samples option to deal with unreliable functions and to continue benchmarking using previously calculated results even if the code crashed during the run
|
@@ -8,9 +8,7 @@ import bencher as bch
|
|
8
8
|
from bencher.example.benchmark_data import ExampleBenchCfgIn, ExampleBenchCfgOut, bench_function
|
9
9
|
|
10
10
|
|
11
|
-
def example_1D_cat(
|
12
|
-
run_cfg: bch.BenchRunCfg = bch.BenchRunCfg(), report: bch.BenchReport = bch.BenchReport()
|
13
|
-
) -> bch.Bench:
|
11
|
+
def example_1D_cat(run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None) -> bch.Bench:
|
14
12
|
"""This example shows how to sample a 1 dimensional categorical variable and plot the result of passing that parameter sweep to the benchmarking function
|
15
13
|
|
16
14
|
Args:
|
@@ -16,14 +16,15 @@ class SimpleFloat(bch.ParametrizedSweep):
|
|
16
16
|
return super().__call__(**kwargs)
|
17
17
|
|
18
18
|
|
19
|
-
def
|
19
|
+
def example_simple_float(
|
20
|
+
run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None
|
21
|
+
) -> bch.Bench:
|
20
22
|
"""This example shows how to sample a 1 dimensional float variable and plot the result of passing that parameter sweep to the benchmarking function"""
|
21
23
|
|
22
24
|
bench = SimpleFloat().to_bench(run_cfg, report)
|
23
25
|
bench.plot_sweep()
|
24
|
-
bench.report.append(bench.get_result().to_explorer())
|
25
26
|
return bench
|
26
27
|
|
27
28
|
|
28
29
|
if __name__ == "__main__":
|
29
|
-
|
30
|
+
example_simple_float().report.show()
|
@@ -27,9 +27,7 @@ class TestPrinting(bch.ParametrizedSweep):
|
|
27
27
|
return super().__call__()
|
28
28
|
|
29
29
|
|
30
|
-
def example_strings(
|
31
|
-
run_cfg: bch.BenchRunCfg = bch.BenchRunCfg(), report: bch.BenchReport = bch.BenchReport()
|
32
|
-
) -> bch.Bench:
|
30
|
+
def example_strings(run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None) -> bch.Bench:
|
33
31
|
bench = bch.Bench("strings", TestPrinting(), run_cfg=run_cfg, report=report)
|
34
32
|
|
35
33
|
for s in [
|
@@ -9,7 +9,7 @@ from bencher.example.benchmark_data import ExampleBenchCfgIn, ExampleBenchCfgOut
|
|
9
9
|
|
10
10
|
|
11
11
|
def example_time_event(
|
12
|
-
run_cfg: bch.BenchRunCfg =
|
12
|
+
run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None
|
13
13
|
) -> bch.Bench:
|
14
14
|
"""This example shows how to manually set time events as a string so that progress can be monitored over time"""
|
15
15
|
|
@@ -75,9 +75,7 @@ class TuringPattern(bch.ParametrizedSweep):
|
|
75
75
|
return super().__call__()
|
76
76
|
|
77
77
|
|
78
|
-
def example_video(
|
79
|
-
run_cfg: bch.BenchRunCfg = bch.BenchRunCfg(), report: bch.BenchReport = bch.BenchReport()
|
80
|
-
) -> bch.Bench:
|
78
|
+
def example_video(run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None) -> bch.Bench:
|
81
79
|
bench = TuringPattern().to_bench(run_cfg, report)
|
82
80
|
|
83
81
|
bench.plot_sweep(
|
@@ -90,7 +88,7 @@ def example_video(
|
|
90
88
|
|
91
89
|
|
92
90
|
def example_video_tap(
|
93
|
-
run_cfg: bch.BenchRunCfg =
|
91
|
+
run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None
|
94
92
|
) -> bch.Bench: # pragma: no cover
|
95
93
|
bench = TuringPattern().to_bench(run_cfg=run_cfg, report=report)
|
96
94
|
res = bench.plot_sweep(input_vars=["alpha", "beta"])
|
@@ -0,0 +1,54 @@
|
|
1
|
+
"""This file has some examples for how to perform basic benchmarking parameter sweeps"""
|
2
|
+
|
3
|
+
import bencher as bch
|
4
|
+
import random
|
5
|
+
|
6
|
+
|
7
|
+
class SimpleFloat0D(bch.ParametrizedSweep):
|
8
|
+
"""This class has 0 input dimensions and 1 output dimensions. It samples from a gaussian distribution"""
|
9
|
+
|
10
|
+
# This defines a variable that we want to plot
|
11
|
+
output = bch.ResultVar(units="ul", doc="a sample from a gaussian distribution")
|
12
|
+
|
13
|
+
def __call__(self, **kwargs) -> dict:
|
14
|
+
"""Generate a sample from a uniform distribution
|
15
|
+
|
16
|
+
Returns:
|
17
|
+
dict: a dictionary with all the result variables in the ParametrisedSweep class as named key value pairs.
|
18
|
+
"""
|
19
|
+
|
20
|
+
self.output = random.gauss(mu=0.0, sigma=1.0)
|
21
|
+
return super().__call__(**kwargs)
|
22
|
+
|
23
|
+
|
24
|
+
def example_0_in_1_out(
|
25
|
+
run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None
|
26
|
+
) -> bch.Bench:
|
27
|
+
"""This example shows how to sample a 1 dimensional float variable and plot the result of passing that parameter sweep to the benchmarking function"""
|
28
|
+
|
29
|
+
bench = SimpleFloat0D().to_bench(run_cfg, report)
|
30
|
+
bench.plot_sweep()
|
31
|
+
|
32
|
+
bench.report.append(bench.get_result().to_table())
|
33
|
+
return bench
|
34
|
+
|
35
|
+
|
36
|
+
if __name__ == "__main__":
|
37
|
+
run_config = bch.BenchRunCfg(repeats=100)
|
38
|
+
reprt = bch.BenchReport()
|
39
|
+
# example_0_in_1_out(run_cfg, report).report.show()
|
40
|
+
|
41
|
+
# run_cfg.over_time = True
|
42
|
+
# run_cfg.cache_samples = True
|
43
|
+
# for i in range(4):
|
44
|
+
# example_0_in_1_out(run_cfg, report)
|
45
|
+
|
46
|
+
run_config.over_time = True
|
47
|
+
run_config.auto_plot = False
|
48
|
+
for _ in range(4):
|
49
|
+
example_0_in_1_out(run_config, reprt)
|
50
|
+
|
51
|
+
run_config.auto_plot = True
|
52
|
+
example_0_in_1_out(run_config, reprt)
|
53
|
+
|
54
|
+
reprt.show()
|
@@ -8,7 +8,8 @@ class SimpleFloat0D(bch.ParametrizedSweep):
|
|
8
8
|
"""This class has 0 input dimensions and 1 output dimensions. It samples from a gaussian distribution"""
|
9
9
|
|
10
10
|
# This defines a variable that we want to plot
|
11
|
-
|
11
|
+
output1 = bch.ResultVar(units="ul", doc="a sample from a gaussian distribution")
|
12
|
+
output2 = bch.ResultVar(units="ul", doc="a sample from a gaussian distribution")
|
12
13
|
|
13
14
|
def __call__(self, **kwargs) -> dict:
|
14
15
|
"""Generate a sample from a uniform distribution
|
@@ -17,11 +18,14 @@ class SimpleFloat0D(bch.ParametrizedSweep):
|
|
17
18
|
dict: a dictionary with all the result variables in the ParametrisedSweep class as named key value pairs.
|
18
19
|
"""
|
19
20
|
|
20
|
-
self.
|
21
|
+
self.output1 = random.gauss(mu=0.0, sigma=1.0)
|
22
|
+
self.output2 = random.gauss(mu=2.0, sigma=5.0)
|
21
23
|
return super().__call__(**kwargs)
|
22
24
|
|
23
25
|
|
24
|
-
def
|
26
|
+
def example_0_in_2_out(
|
27
|
+
run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None
|
28
|
+
) -> bch.Bench:
|
25
29
|
"""This example shows how to sample a 1 dimensional float variable and plot the result of passing that parameter sweep to the benchmarking function"""
|
26
30
|
|
27
31
|
bench = SimpleFloat0D().to_bench(run_cfg, report)
|
@@ -30,5 +34,5 @@ def example_0D(run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None)
|
|
30
34
|
|
31
35
|
|
32
36
|
if __name__ == "__main__":
|
33
|
-
run_config = bch.BenchRunCfg(repeats=
|
34
|
-
|
37
|
+
run_config = bch.BenchRunCfg(repeats=500)
|
38
|
+
example_0_in_2_out(run_config).report.show()
|
@@ -0,0 +1,69 @@
|
|
1
|
+
"""This file has some examples for how to perform basic benchmarking parameter sweeps"""
|
2
|
+
|
3
|
+
import bencher as bch
|
4
|
+
|
5
|
+
|
6
|
+
class DataSource:
|
7
|
+
def __init__(self):
|
8
|
+
self.data = [
|
9
|
+
[0, 0, 0, 0],
|
10
|
+
[1, 1, 1, 1],
|
11
|
+
[1, 1, 1, 1],
|
12
|
+
[2, 1, 1, 0],
|
13
|
+
[2, 2, 0, 0],
|
14
|
+
[2, 2, 1, 1],
|
15
|
+
]
|
16
|
+
|
17
|
+
self.call_count = [0] * len(self.data)
|
18
|
+
|
19
|
+
def call(self, index, repeat=None):
|
20
|
+
if repeat is None:
|
21
|
+
self.call_count[index] += 1
|
22
|
+
repeat = self.call_count[index]
|
23
|
+
return self.data[index][repeat - 1]
|
24
|
+
|
25
|
+
|
26
|
+
class Example1D(bch.ParametrizedSweep):
|
27
|
+
index = bch.IntSweep(default=0, bounds=[0, 5], doc="Input angle", units="rad", samples=30)
|
28
|
+
output = bch.ResultVar(units="v", doc="sin of theta")
|
29
|
+
output2 = bch.ResultVar(units="v", doc="-sin of theta")
|
30
|
+
|
31
|
+
def __init__(self, **params):
|
32
|
+
super().__init__(**params)
|
33
|
+
self.data1 = DataSource()
|
34
|
+
self.data2 = DataSource()
|
35
|
+
|
36
|
+
def __call__(self, **kwargs):
|
37
|
+
self.update_params_from_kwargs(**kwargs)
|
38
|
+
self.output = self.data1.call(self.index)
|
39
|
+
self.output2 = -self.data2.call(self.index)
|
40
|
+
return super().__call__(**kwargs)
|
41
|
+
|
42
|
+
|
43
|
+
def example_1_in_2_out(
|
44
|
+
run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None
|
45
|
+
) -> bch.Bench:
|
46
|
+
"""This example shows how to sample a 1 dimensional float variable and plot the result of passing that parameter sweep to the benchmarking function"""
|
47
|
+
bench = Example1D().to_bench(run_cfg, report)
|
48
|
+
bench.plot_sweep()
|
49
|
+
|
50
|
+
# bench.report.append(bench.get_result().to_heatmap())
|
51
|
+
return bench
|
52
|
+
|
53
|
+
|
54
|
+
if __name__ == "__main__":
|
55
|
+
run_config = bch.BenchRunCfg()
|
56
|
+
reprt = bch.BenchReport()
|
57
|
+
example_1_in_2_out(run_config, reprt)
|
58
|
+
|
59
|
+
run_config.repeats = 4
|
60
|
+
example_1_in_2_out(run_config, reprt)
|
61
|
+
|
62
|
+
# run_config.over_time = True
|
63
|
+
# run_config.auto_plot = False
|
64
|
+
# for i in range(4):
|
65
|
+
# example_1_in_2_out(run_config, reprt)
|
66
|
+
|
67
|
+
# run_config.auto_plot = True
|
68
|
+
# example_1_in_2_out(run_config, reprt)
|
69
|
+
reprt.show()
|
@@ -14,7 +14,13 @@ class DataSource:
|
|
14
14
|
[2, 2, 1, 1],
|
15
15
|
]
|
16
16
|
|
17
|
-
|
17
|
+
self.call_count = [0] * len(self.data)
|
18
|
+
|
19
|
+
def call(self, index, repeat=None):
|
20
|
+
if repeat is None:
|
21
|
+
self.call_count[index] += 1
|
22
|
+
repeat = self.call_count[index]
|
23
|
+
print(index, repeat)
|
18
24
|
return self.data[index][repeat - 1]
|
19
25
|
|
20
26
|
|
@@ -22,23 +28,35 @@ class Example1D(bch.ParametrizedSweep):
|
|
22
28
|
index = bch.IntSweep(default=0, bounds=[0, 5], doc="Input angle", units="rad", samples=30)
|
23
29
|
output = bch.ResultVar(units="v", doc="sin of theta")
|
24
30
|
|
31
|
+
def __init__(self, **params):
|
32
|
+
super().__init__(**params)
|
33
|
+
self.data1 = DataSource()
|
34
|
+
|
25
35
|
def __call__(self, **kwargs):
|
26
36
|
self.update_params_from_kwargs(**kwargs)
|
27
|
-
self.output =
|
37
|
+
self.output = self.data1.call(self.index)
|
28
38
|
return super().__call__(**kwargs)
|
29
39
|
|
30
40
|
|
31
|
-
def
|
41
|
+
def example_1_in_1_out(
|
32
42
|
run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None
|
33
43
|
) -> bch.Bench:
|
34
44
|
"""This example shows how to sample a 1 dimensional float variable and plot the result of passing that parameter sweep to the benchmarking function"""
|
35
|
-
|
36
45
|
bench = Example1D().to_bench(run_cfg, report)
|
37
|
-
bench.
|
38
|
-
bench.plot_sweep(pass_repeat=True)
|
39
|
-
|
46
|
+
bench.plot_sweep()
|
40
47
|
return bench
|
41
48
|
|
42
49
|
|
43
50
|
if __name__ == "__main__":
|
44
|
-
|
51
|
+
run_config = bch.BenchRunCfg()
|
52
|
+
reprt = bch.BenchReport()
|
53
|
+
example_1_in_1_out(run_config, reprt)
|
54
|
+
|
55
|
+
run_config.repeats = 4
|
56
|
+
example_1_in_1_out(run_config, reprt)
|
57
|
+
|
58
|
+
# run_cfg.over_time = True
|
59
|
+
# for i in range(4):
|
60
|
+
# example_1_in_2_out(run_cfg, report)
|
61
|
+
|
62
|
+
reprt.show()
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import bencher as bch
|
2
|
+
|
3
|
+
|
4
|
+
class DataSource:
|
5
|
+
def __init__(self):
|
6
|
+
self.data = [
|
7
|
+
[0, 0, 0, 0],
|
8
|
+
[1, 1, 1, 1],
|
9
|
+
[1, 1, 1, 1],
|
10
|
+
[2, 1, 1, 0],
|
11
|
+
[2, 2, 0, 0],
|
12
|
+
[2, 2, 1, 1],
|
13
|
+
]
|
14
|
+
|
15
|
+
self.call_count = [0] * len(self.data)
|
16
|
+
|
17
|
+
def call(self, index, repeat=None):
|
18
|
+
if repeat is None:
|
19
|
+
self.call_count[index] += 1
|
20
|
+
repeat = self.call_count[index]
|
21
|
+
return self.data[index][repeat - 1]
|
22
|
+
|
23
|
+
|
24
|
+
class Example1D(bch.ParametrizedSweep):
|
25
|
+
index = bch.IntSweep(default=0, bounds=[0, 5], doc="Input angle", units="rad", samples=30)
|
26
|
+
output = bch.ResultVar(units="v", doc="sin of theta")
|
27
|
+
output2 = bch.ResultVar(units="v", doc="-sin of theta")
|
28
|
+
|
29
|
+
def __init__(self, **params):
|
30
|
+
super().__init__(**params)
|
31
|
+
self.data1 = DataSource()
|
32
|
+
self.data2 = DataSource()
|
33
|
+
|
34
|
+
def __call__(self, **kwargs):
|
35
|
+
self.update_params_from_kwargs(**kwargs)
|
36
|
+
self.output = self.data1.call(self.index)
|
37
|
+
self.output2 = -self.data2.call(self.index)
|
38
|
+
return super().__call__(**kwargs)
|
39
|
+
|
40
|
+
|
41
|
+
def example_1_in_2_out(
|
42
|
+
run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None
|
43
|
+
) -> bch.Bench:
|
44
|
+
"""This example shows how to sample a 1 dimensional float variable and plot the result of passing that parameter sweep to the benchmarking function"""
|
45
|
+
bench = Example1D().to_bench(run_cfg, report)
|
46
|
+
bench.plot_sweep()
|
47
|
+
|
48
|
+
# bench.report.append(bench.get_result().to_heatmap())
|
49
|
+
return bench
|
50
|
+
|
51
|
+
|
52
|
+
if __name__ == "__main__":
|
53
|
+
run_config = bch.BenchRunCfg()
|
54
|
+
reprt = bch.BenchReport()
|
55
|
+
example_1_in_2_out(run_config, reprt)
|
56
|
+
# run_config.over_time = True
|
57
|
+
# run_config.auto_plot = False
|
58
|
+
# for i in range(4):
|
59
|
+
# example_1_in_2_out(run_config, reprt)
|
60
|
+
|
61
|
+
# run_config.auto_plot = True
|
62
|
+
# example_1_in_2_out(run_config, reprt)
|
63
|
+
reprt.show()
|