holobench 1.40.1__py3-none-any.whl → 1.42.0__py3-none-any.whl

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.
Files changed (93) hide show
  1. CHANGELOG.md +10 -0
  2. bencher/__init__.py +20 -2
  3. bencher/bench_cfg.py +265 -61
  4. bencher/bench_report.py +2 -2
  5. bencher/bench_runner.py +96 -10
  6. bencher/bencher.py +421 -89
  7. bencher/caching.py +1 -4
  8. bencher/class_enum.py +70 -7
  9. bencher/example/example_composable_container_image.py +60 -0
  10. bencher/example/example_composable_container_video.py +49 -0
  11. bencher/example/example_dataframe.py +2 -2
  12. bencher/example/example_image.py +17 -21
  13. bencher/example/example_image1.py +16 -20
  14. bencher/example/example_levels.py +17 -173
  15. bencher/example/example_pareto.py +107 -31
  16. bencher/example/example_rerun2.py +1 -1
  17. bencher/example/example_simple_bool.py +2 -2
  18. bencher/example/example_simple_float2d.py +6 -1
  19. bencher/example/example_video.py +35 -17
  20. bencher/example/experimental/example_hvplot_explorer.py +3 -4
  21. bencher/example/inputs_0D/example_0_in_1_out.py +25 -15
  22. bencher/example/inputs_0D/example_0_in_2_out.py +12 -3
  23. bencher/example/inputs_0_float/example_0_cat_in_2_out.py +88 -0
  24. bencher/example/inputs_0_float/example_1_cat_in_2_out.py +98 -0
  25. bencher/example/inputs_0_float/example_2_cat_in_2_out.py +107 -0
  26. bencher/example/inputs_0_float/example_3_cat_in_2_out.py +111 -0
  27. bencher/example/inputs_1D/example1d_common.py +48 -12
  28. bencher/example/inputs_1D/example_0_float_1_cat.py +33 -0
  29. bencher/example/inputs_1D/example_1_cat_in_2_out_repeats.py +68 -0
  30. bencher/example/inputs_1D/example_1_float_2_cat_repeats.py +15 -0
  31. bencher/example/inputs_1D/example_1_int_in_1_out.py +98 -0
  32. bencher/example/inputs_1D/example_1_int_in_2_out.py +101 -0
  33. bencher/example/inputs_1D/example_1_int_in_2_out_repeats.py +99 -0
  34. bencher/example/inputs_1_float/example_1_float_0_cat_in_2_out.py +117 -0
  35. bencher/example/inputs_1_float/example_1_float_1_cat_in_2_out.py +124 -0
  36. bencher/example/inputs_1_float/example_1_float_2_cat_in_2_out.py +132 -0
  37. bencher/example/inputs_1_float/example_1_float_3_cat_in_2_out.py +140 -0
  38. bencher/example/inputs_2D/example_2_cat_in_4_out_repeats.py +104 -0
  39. bencher/example/inputs_2_float/example_2_float_0_cat_in_2_out.py +98 -0
  40. bencher/example/inputs_2_float/example_2_float_1_cat_in_2_out.py +112 -0
  41. bencher/example/inputs_2_float/example_2_float_2_cat_in_2_out.py +122 -0
  42. bencher/example/inputs_2_float/example_2_float_3_cat_in_2_out.py +138 -0
  43. bencher/example/inputs_3_float/example_3_float_0_cat_in_2_out.py +111 -0
  44. bencher/example/inputs_3_float/example_3_float_1_cat_in_2_out.py +117 -0
  45. bencher/example/inputs_3_float/example_3_float_2_cat_in_2_out.py +124 -0
  46. bencher/example/inputs_3_float/example_3_float_3_cat_in_2_out.py +129 -0
  47. bencher/example/meta/generate_examples.py +124 -7
  48. bencher/example/meta/generate_meta.py +88 -40
  49. bencher/job.py +175 -12
  50. bencher/plotting/plot_filter.py +52 -17
  51. bencher/results/bench_result.py +119 -26
  52. bencher/results/bench_result_base.py +119 -10
  53. bencher/results/composable_container/composable_container_video.py +39 -12
  54. bencher/results/dataset_result.py +6 -200
  55. bencher/results/explorer_result.py +23 -0
  56. bencher/results/{hvplot_result.py → histogram_result.py} +3 -18
  57. bencher/results/holoview_results/__init__.py +0 -0
  58. bencher/results/holoview_results/bar_result.py +79 -0
  59. bencher/results/holoview_results/curve_result.py +110 -0
  60. bencher/results/holoview_results/distribution_result/__init__.py +0 -0
  61. bencher/results/holoview_results/distribution_result/box_whisker_result.py +73 -0
  62. bencher/results/holoview_results/distribution_result/distribution_result.py +109 -0
  63. bencher/results/holoview_results/distribution_result/scatter_jitter_result.py +92 -0
  64. bencher/results/holoview_results/distribution_result/violin_result.py +70 -0
  65. bencher/results/holoview_results/heatmap_result.py +319 -0
  66. bencher/results/holoview_results/holoview_result.py +346 -0
  67. bencher/results/holoview_results/line_result.py +240 -0
  68. bencher/results/holoview_results/scatter_result.py +107 -0
  69. bencher/results/holoview_results/surface_result.py +158 -0
  70. bencher/results/holoview_results/table_result.py +14 -0
  71. bencher/results/holoview_results/tabulator_result.py +20 -0
  72. bencher/results/laxtex_result.py +42 -35
  73. bencher/results/optuna_result.py +30 -115
  74. bencher/results/video_controls.py +38 -0
  75. bencher/results/video_result.py +39 -36
  76. bencher/results/video_summary.py +2 -2
  77. bencher/results/{plotly_result.py → volume_result.py} +29 -8
  78. bencher/utils.py +176 -30
  79. bencher/variables/inputs.py +122 -15
  80. bencher/video_writer.py +38 -2
  81. bencher/worker_job.py +34 -7
  82. {holobench-1.40.1.dist-info → holobench-1.42.0.dist-info}/METADATA +21 -25
  83. holobench-1.42.0.dist-info/RECORD +147 -0
  84. bencher/example/example_composable_container.py +0 -106
  85. bencher/example/example_levels2.py +0 -37
  86. bencher/example/inputs_1D/example_1_in_1_out.py +0 -62
  87. bencher/example/inputs_1D/example_1_in_2_out.py +0 -63
  88. bencher/example/inputs_1D/example_1_in_2_out_repeats.py +0 -61
  89. bencher/results/holoview_result.py +0 -787
  90. bencher/results/panel_result.py +0 -41
  91. holobench-1.40.1.dist-info/RECORD +0 -111
  92. {holobench-1.40.1.dist-info → holobench-1.42.0.dist-info}/WHEEL +0 -0
  93. {holobench-1.40.1.dist-info → holobench-1.42.0.dist-info}/licenses/LICENSE +0 -0
bencher/worker_job.py CHANGED
@@ -1,29 +1,56 @@
1
1
  from typing import List, Tuple, Any
2
2
  from dataclasses import dataclass, field
3
- from sortedcontainers import SortedDict
4
3
  from .utils import hash_sha1
5
4
  from bencher.utils import hmap_canonical_input
6
5
 
7
6
 
8
7
  @dataclass
9
8
  class WorkerJob:
10
- function_input_vars: List
11
- index_tuple: Tuple[int]
9
+ """Represents a benchmark worker job with input variables and caching information.
10
+
11
+ This class encapsulates the information needed to execute a benchmark function,
12
+ including input variables, dimension information, and caching metadata. It handles
13
+ the preparation of function inputs and calculation of hash signatures for caching.
14
+
15
+ Attributes:
16
+ function_input_vars (List): The values of the input variables to pass to the function
17
+ index_tuple (Tuple[int]): The indices of these values in the N-dimensional result array
18
+ dims_name (List[str]): The names of the input dimensions
19
+ constant_inputs (dict): Dictionary of any constant input values
20
+ bench_cfg_sample_hash (str): Hash of the benchmark configuration without repeats
21
+ tag (str): Tag for grouping related jobs
22
+ function_input (dict): Complete input as a dictionary with dimension names as keys
23
+ canonical_input (Tuple[Any]): Canonical representation of inputs for caching
24
+ fn_inputs_sorted (List[Tuple[str, Any]]): Sorted representation of function inputs
25
+ function_input_signature_pure (str): Hash of the function inputs and tag
26
+ function_input_signature_benchmark_context (str): Comprehensive hash including benchmark context
27
+ found_in_cache (bool): Whether this job result was found in cache
28
+ msgs (List[str]): Messages related to this job's execution
29
+ """
30
+
31
+ function_input_vars: List[Any]
32
+ index_tuple: Tuple[int, ...]
12
33
  dims_name: List[str]
13
34
  constant_inputs: dict
14
35
  bench_cfg_sample_hash: str
15
36
  tag: str
16
37
 
17
- function_input: SortedDict = None
38
+ function_input: dict = None
18
39
  canonical_input: Tuple[Any] = None
19
- fn_inputs_sorted: List[str] = None
40
+ fn_inputs_sorted: List[Tuple[str, Any]] = None
20
41
  function_input_signature_pure: str = None
21
42
  function_input_signature_benchmark_context: str = None
22
43
  found_in_cache: bool = False
23
44
  msgs: List[str] = field(default_factory=list)
24
45
 
25
46
  def setup_hashes(self) -> None:
26
- self.function_input = SortedDict(zip(self.dims_name, self.function_input_vars))
47
+ """Set up the function inputs and calculate hash signatures for caching.
48
+
49
+ This method prepares the function inputs by combining function input variables
50
+ with dimensions and constant inputs. It also calculates hash signatures used
51
+ for caching results and tracking job execution.
52
+ """
53
+ self.function_input = dict(zip(self.dims_name, self.function_input_vars))
27
54
 
28
55
  self.canonical_input = hmap_canonical_input(self.function_input)
29
56
 
@@ -32,7 +59,7 @@ class WorkerJob:
32
59
 
33
60
  # store a tuple of the inputs as keys for a holomap
34
61
  # the signature is the hash of the inputs to to the function + meta variables such as repeat and time + the hash of the benchmark sweep as a whole (without the repeats hash)
35
- self.fn_inputs_sorted = list(SortedDict(self.function_input).items())
62
+ self.fn_inputs_sorted = sorted(self.function_input.items())
36
63
  self.function_input_signature_pure = hash_sha1((self.fn_inputs_sorted, self.tag))
37
64
 
38
65
  self.function_input_signature_benchmark_context = hash_sha1(
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: holobench
3
- Version: 1.40.1
3
+ Version: 1.42.0
4
4
  Summary: A package for benchmarking the performance of arbitrary functions
5
- Project-URL: Repository, https://github.com/dyson-ai/bencher
6
- Project-URL: Home, https://github.com/dyson-ai/bencher
5
+ Project-URL: Repository, https://github.com/blooop/bencher
6
+ Project-URL: Home, https://github.com/blooop/bencher
7
7
  Project-URL: Documentation, https://bencher.readthedocs.io/en/latest/
8
8
  Author-email: Austin Gregg-Smith <blooop@gmail.com>
9
9
  License-Expression: MIT
@@ -12,48 +12,44 @@ Requires-Python: <3.13,>=3.10
12
12
  Requires-Dist: diskcache<=5.6.3,>=5.6
13
13
  Requires-Dist: holoviews<=1.20.0,>=1.15
14
14
  Requires-Dist: hvplot<=0.10.0,>=0.8
15
- Requires-Dist: matplotlib<=3.10.0,>=3.6.3
16
- Requires-Dist: moviepy-fix-codec
17
- Requires-Dist: numpy<=2.2.2,>=1.0
18
- Requires-Dist: optuna<=4.2.0,>=3.2
15
+ Requires-Dist: moviepy<=2.1.2,>=2.1.2
16
+ Requires-Dist: numpy<=2.2.6,>=1.0
17
+ Requires-Dist: optuna<=4.3.0,>=3.2
19
18
  Requires-Dist: pandas<=2.2.3,>=2.0
20
- Requires-Dist: panel<=1.6.0,>=1.3.6
19
+ Requires-Dist: panel<=1.7.0,>=1.3.6
21
20
  Requires-Dist: param<=2.2.0,>=1.13.0
22
- Requires-Dist: plotly<=6.0.0,>=5.15
21
+ Requires-Dist: plotly<=6.0.1,>=5.15
23
22
  Requires-Dist: scikit-learn<=1.6.1,>=1.2
24
- Requires-Dist: scoop<=0.7.2.0,>=0.7.0
25
- Requires-Dist: sortedcontainers<=2.4,>=2.4
26
- Requires-Dist: str2bool<=1.1,>=1.1
27
23
  Requires-Dist: strenum<=0.4.15,>=0.4.0
28
- Requires-Dist: xarray<=2025.1.2,>=2023.7
24
+ Requires-Dist: xarray<=2025.4.0,>=2023.7
29
25
  Provides-Extra: rerun
30
26
  Requires-Dist: flask; extra == 'rerun'
31
27
  Requires-Dist: flask-cors; extra == 'rerun'
32
28
  Requires-Dist: rerun-notebook; extra == 'rerun'
33
- Requires-Dist: rerun-sdk==0.21.0; extra == 'rerun'
29
+ Requires-Dist: rerun-sdk==0.22.1; extra == 'rerun'
34
30
  Provides-Extra: test
35
- Requires-Dist: coverage<=7.6.10,>=7.5.4; extra == 'test'
36
- Requires-Dist: hypothesis<=6.124.9,>=6.104.2; extra == 'test'
31
+ Requires-Dist: coverage<=7.8.0,>=7.5.4; extra == 'test'
32
+ Requires-Dist: hypothesis<=6.131.18,>=6.104.2; extra == 'test'
37
33
  Requires-Dist: ipykernel; extra == 'test'
38
34
  Requires-Dist: jupyter-bokeh; extra == 'test'
39
35
  Requires-Dist: nbformat; extra == 'test'
40
36
  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'
43
- Requires-Dist: pytest-cov<=6.0.0,>=4.1; extra == 'test'
44
- Requires-Dist: pytest<=8.3.4,>=7.4; extra == 'test'
45
- Requires-Dist: ruff<=0.9.4,>=0.5.0; extra == 'test'
37
+ Requires-Dist: pre-commit<=4.2.0; extra == 'test'
38
+ Requires-Dist: pylint<=3.3.7,>=3.2.5; extra == 'test'
39
+ Requires-Dist: pytest-cov<=6.1.1,>=4.1; extra == 'test'
40
+ Requires-Dist: pytest<=8.3.5,>=7.4; extra == 'test'
41
+ Requires-Dist: ruff<=0.11.10,>=0.5.0; extra == 'test'
46
42
  Description-Content-Type: text/markdown
47
43
 
48
44
  # Bencher
49
45
 
50
46
  ## Continuous Integration Status
51
47
 
52
- [![Ci](https://github.com/dyson-ai/bencher/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/dyson-ai/bencher/actions/workflows/ci.yml?query=branch%3Amain)
48
+ [![Ci](https://github.com/blooop/bencher/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/blooop/bencher/actions/workflows/ci.yml?query=branch%3Amain)
53
49
  ![Read the Docs](https://img.shields.io/readthedocs/bencher)
54
- [![Codecov](https://codecov.io/gh/dyson-ai/bencher/branch/main/graph/badge.svg?token=Y212GW1PG6)](https://codecov.io/gh/dyson-ai/bencher)
55
- [![GitHub issues](https://img.shields.io/github/issues/dyson-ai/bencher.svg)](https://GitHub.com/dyson-ai/bencher/issues/)
56
- [![GitHub pull-requests merged](https://badgen.net/github/merged-prs/dyson-ai/bencher)](https://github.com/dyson-ai/bencher/pulls?q=is%3Amerged)
50
+ [![Codecov](https://codecov.io/gh/blooop/bencher/branch/main/graph/badge.svg?token=Y212GW1PG6)](https://codecov.io/gh/blooop/bencher)
51
+ [![GitHub issues](https://img.shields.io/github/issues/blooop/bencher.svg)](https://GitHub.com/blooop/bencher/issues/)
52
+ [![GitHub pull-requests merged](https://badgen.net/github/merged-prs/blooop/bencher)](https://github.com/blooop/bencher/pulls?q=is%3Amerged)
57
53
  [![PyPI](https://img.shields.io/pypi/v/holobench)](https://pypi.org/project/holobench/)
58
54
  [![PyPI - Downloads](https://img.shields.io/pypi/dm/holobench)](https://pypistats.org/packages/holobench)
59
55
  [![License](https://img.shields.io/pypi/l/bencher)](https://opensource.org/license/mit/)
@@ -0,0 +1,147 @@
1
+ CHANGELOG.md,sha256=alEi3CoMNOpKigEqP1uvdpuZMkpHJFCfO-tx8a_utss,284
2
+ bencher/__init__.py,sha256=dbU2htfHzXkJakbQ5L5kBCcF2FKVGPlZZ83dr24l9zc,2969
3
+ bencher/bench_cfg.py,sha256=tm9S9l6YG_NQUQaLqT6fCL9Jfb0tKiYri9fDWuPgL8w,29256
4
+ bencher/bench_plot_server.py,sha256=nvGTr981XgWELqV7yID91j6V1UIPGtKilzxHcNWaZ6Q,4196
5
+ bencher/bench_report.py,sha256=QejKL1jgGmx6TGZ_RIiyQ6KEqF8bRQ9IaA4ync81S8E,7511
6
+ bencher/bench_runner.py,sha256=3ZrfUU01WoHMRodfTQwkYFPA_ZRcZg5XTIagz317bbs,11088
7
+ bencher/bencher.py,sha256=YsM-T5vzMxh1CSutfZM6iWrAsDcNsi3WXpfWYv5AyZE,52253
8
+ bencher/caching.py,sha256=RYvh6FLcYlMrfYcbkK5k8ZnT4lP2g5klUgo1oPfXhxg,1565
9
+ bencher/class_enum.py,sha256=9ewhDzRDGwVg9VvasZzyiZEKLEPKzE7yBo8PqhUixfg,3492
10
+ bencher/flask_server.py,sha256=uMhMaySUki5StC-r_TXb4KTVqAiffyqfH7UzQidFqSw,831
11
+ bencher/job.py,sha256=mHFytylOlMuvrrGCKGGIrR2yCcPNUNFeLQD2D2KNgNM,13320
12
+ bencher/optuna_conversions.py,sha256=an-LfPsQXyyvhIZnG8Wl1RQVYMvJj7WOi3YNqoUnuxQ,5356
13
+ bencher/utils.py,sha256=_Bud-2zsF5P2w1Im7LiT5aUIl7Ierwy0S3Yxw0HqPvo,15198
14
+ bencher/utils_rerun.py,sha256=E1itolYJMjmtBE5qcSotiS20I-dobVnjznsTRvZaV0s,1212
15
+ bencher/video_writer.py,sha256=XjEKnBl0Qw_EqoxfGIClEI-4IMPpfLaiG2Td8jx90NA,3675
16
+ bencher/worker_job.py,sha256=jVfiFKtzDuFka57tDb3SBtqD1W3h_SjkoxZnFIjuJ3c,3284
17
+ bencher/example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
+ bencher/example/benchmark_data.py,sha256=DL5Grj7UwnKZz2BHfGNKv35Ln0y2ntFwvZdkchOMHVU,6985
19
+ bencher/example/example_all.py,sha256=_jOiz07fsjghiIuLfMpZiRVEkPaH7dM8OftOGcdL6cU,1960
20
+ bencher/example/example_categorical.py,sha256=S6PP3LHZewHVymNZmEY-AEMRlJbv0CEgJ1NRWNDEnC8,3659
21
+ bencher/example/example_composable_container2.py,sha256=tVcSggLAzuXsiHM00qSJk9fKOgqXbSzzyjs7IayLZCw,5667
22
+ bencher/example/example_composable_container_image.py,sha256=FPk0JUWr8aKRMk5x7CfR2z97a6QNt2BEA_BFgsjwav4,1961
23
+ bencher/example/example_composable_container_video.py,sha256=1kClqIP5ueOBEGSo1NJybmydCYfeyU3GmaqLwvGgfyQ,1849
24
+ bencher/example/example_consts.py,sha256=upKkrMNYUCS38IA4duuyJHERwdZIMB4FA60Gytu_BzU,1475
25
+ bencher/example/example_custom_sweep.py,sha256=OvAMqirV9KzbuaQ6ELOAbrRrj5zYHjpEs3tG-rgmFJM,1891
26
+ bencher/example/example_custom_sweep2.py,sha256=6RBiyVVaxAh5Aul85DfYA5P-lwhwW3Bb54o0CBgTB6Q,1225
27
+ bencher/example/example_dataframe.py,sha256=GzOYHNAmz0YZDYYvPzNDSCLiySY8PE2ZYdTCZyYZIbs,1778
28
+ bencher/example/example_docs.py,sha256=j80DCZqfvfkzvy7kgasSvq4F011ZHuq8jjFsEWiFTMk,1200
29
+ bencher/example/example_filepath.py,sha256=O3VO9rWAXB_1tagVSvxhiSMjcTkgZe2duw7W17ij7po,827
30
+ bencher/example/example_float3D.py,sha256=QBPET3oxRJXM5ToXdOPtIsHd-9SBK8GD9y0gC9N4UC4,3034
31
+ bencher/example/example_float_cat.py,sha256=_jedRBPQmKwxo1Yvph8SnUGVoK5Mpj9aLZIYex31bzQ,3789
32
+ bencher/example/example_floats.py,sha256=x-3wx9-SHueuqjNHuKqEGeYWU7ZdZ1DR7X_1dktOKbg,4237
33
+ bencher/example/example_floats2D.py,sha256=1V5hCxr0Iz2KT2JyePn-XmugsMXlDzf0GazWWvq0kYo,3665
34
+ bencher/example/example_holosweep.py,sha256=emNUKCHPb-JrSWPjHajuAlQmUU9A9S7O-jdrvixg0Io,2989
35
+ bencher/example/example_holosweep_objects.py,sha256=eqOjuTYh4Pis5lGsSeN7BJZXKR2upOSjynEtR0HqyoY,3196
36
+ bencher/example/example_holosweep_tap.py,sha256=vKGyCdc1H8oECWRACW1kj5s1OJPAUETWHbP88R9hW_A,4475
37
+ bencher/example/example_image.py,sha256=QovSZtxepBwNSYDjouTCrhtP3NXJUXYoqRT2sFavsio,5554
38
+ bencher/example/example_image1.py,sha256=XAR99ko6f4KZ6pHKoAebF2agTZRm8Hm5DZ1_lHdO2gI,2817
39
+ bencher/example/example_levels.py,sha256=rWvevr-aoDd9gLDo1l_hdA79T1xUA0OZK2TZHfuFHMA,1396
40
+ bencher/example/example_pareto.py,sha256=PKPYBHkfdeg9Q0HuJT6-aWmdQBlWiTEak8gMA6UKIGg,4752
41
+ bencher/example/example_publish.py,sha256=qIilHdsjqcUQ5u_IuGjjhJCLRkcQvhVuhI3efDrFTww,1005
42
+ bencher/example/example_rerun.py,sha256=gruldZ6tmW56Mc6bPrNc7ChZEGHhYXPE4VVeG-L8w7M,981
43
+ bencher/example/example_rerun2.py,sha256=LMElKpq2laNLP6h-Sc-CIsfoObrQ777CEQDErUcJ98U,658
44
+ bencher/example/example_sample_cache.py,sha256=VxL-lT3IuI57ToDdGZlBvzt_c_bl4AveyylQFMXg-vE,4162
45
+ bencher/example/example_sample_cache_context.py,sha256=v_4hfmwZK38ZqV6QyEfs_I4W3BJX7RO_J-wDaS_DTT0,4062
46
+ bencher/example/example_simple.py,sha256=E1-D10N-O50S33UQ9iLIlq09-x7BohbjYaR_lzLjQjc,11706
47
+ bencher/example/example_simple_bool.py,sha256=eMnYsaPBmXbOyenY1O0htlVr8KW0DeMOS_SmSoPUWhM,1233
48
+ bencher/example/example_simple_cat.py,sha256=cPlt9JP1lgTqatZVAP1tk72lPSLkGkj4BjUl6fpRF_A,1728
49
+ bencher/example/example_simple_float.py,sha256=c3ZR0LXfgGcH63MnUpQovRVnzpx5lpDQs1T-Qzcm2U0,944
50
+ bencher/example/example_simple_float2d.py,sha256=BO04euRK1vYZKTkclLz8bA0p8G-PCR3FtzJN3z3ZhF8,1200
51
+ bencher/example/example_strings.py,sha256=NpOGwC1KRAyAAC2VQZCg09ArraESdU0lupFj4b0I-sQ,1538
52
+ bencher/example/example_time_event.py,sha256=l2dEut9oYnxxF7kRXnZx8Ohw1EdT5Iezo_b8CwCcCHA,2133
53
+ bencher/example/example_video.py,sha256=l0dmsRQlN9zWsJjmFykA3N46LULL-KA5pyexhipyWnc,4579
54
+ bencher/example/example_workflow.py,sha256=00QnUuViMfX_PqzqkXmg1wPX6yAq7IS7mCL_RFKwrMM,6806
55
+ bencher/example/experimental/example_bokeh_plotly.py,sha256=3jUKh8eKIAlpklKnp8UopIHhUDw1A0_5CwjeyTzbi7o,846
56
+ bencher/example/experimental/example_hover_ex.py,sha256=qszw4FkIfqQkVviPSpmUoFOoi6PGotGbsc7Ojyx8EtU,1052
57
+ bencher/example/experimental/example_hvplot_explorer.py,sha256=lIIYDRi0u9VqIGsPG-panFUD7CnRDWKUqlTzltPdQFA,1775
58
+ bencher/example/experimental/example_interactive.py,sha256=MM1A2EVsKTy95RERTNnld0tUmZmCy8N41_jGm2wlG7U,2619
59
+ bencher/example/experimental/example_streamnd.py,sha256=LqkTtdY4NhnP5dEB1Ifv7RQ5Vq4dLkp5E3aWnWuzniA,1414
60
+ bencher/example/experimental/example_streams.py,sha256=rrTmcmxDlirGoyTbJ4LT4fBIAc1k28qjnjy5JxGKyhg,1030
61
+ bencher/example/experimental/example_template.py,sha256=XdIVS9RtLdE5GNnerWiZMXvP7n17lzuc_YTLqJTwb6Q,1172
62
+ bencher/example/experimental/example_updates.py,sha256=rF4UgWY-CW6ohNtOpQklTuwbwVRvEM5j6edZOiMkspQ,1835
63
+ bencher/example/experimental/example_vector.py,sha256=3o_1dA4dc2HL6uIEvDAcvLPVJB8jgkq1QZ3BQIL-LEo,3118
64
+ bencher/example/inputs_0D/example_0_in_1_out.py,sha256=_3HqU_UiLpTTNsFSuzo_LhwE9IU9x_jtoQQ1AhJ04Ok,1927
65
+ bencher/example/inputs_0D/example_0_in_2_out.py,sha256=d5R0c05JlSZeauSBtahjVYX6yovmErHqQRCc0xLxfwg,1550
66
+ bencher/example/inputs_0_float/example_0_cat_in_2_out.py,sha256=uhqtFE5vQWt6pSAWL6i6nPy_W1TopLZm5VPiuZlloXg,3392
67
+ bencher/example/inputs_0_float/example_1_cat_in_2_out.py,sha256=bivYzyykmWmdIE5AmeUFwvQF3wHc5hqLIXheElU-i1E,3895
68
+ bencher/example/inputs_0_float/example_2_cat_in_2_out.py,sha256=ECw1sqizWgNj2hWyCWrDkEQYmuO2KRAOKF2PGuX7XJs,4205
69
+ bencher/example/inputs_0_float/example_3_cat_in_2_out.py,sha256=43VYo7Oh8TkIIZALBcTr7pGtOt8WlOZMhbluQnAW_vo,4308
70
+ bencher/example/inputs_1D/example1d_common.py,sha256=JN3Qjmtqs2aGU1NxBG0Wsw61Bvq_SoFBwjMtGKJchIE,3356
71
+ bencher/example/inputs_1D/example_0_float_1_cat.py,sha256=kR_Bo3UBFioGNCtM2ien3vvyjR_XQmMtLOhxV4ntF0Q,1188
72
+ bencher/example/inputs_1D/example_1_cat_in_2_out_repeats.py,sha256=sLeT08w3k3ua8xAZgZAAPHni5yz6eglmB0upemykjWc,2449
73
+ bencher/example/inputs_1D/example_1_float_2_cat_repeats.py,sha256=y_Gp831Q5VOBZu34LHPqr_PeuBvyD2QuFWbv9DCwMJM,511
74
+ bencher/example/inputs_1D/example_1_int_in_1_out.py,sha256=qpZRDf_l0YASdJOxP4YN8tJrs0JbNTwCuev09KC5z7U,3018
75
+ bencher/example/inputs_1D/example_1_int_in_2_out.py,sha256=eutJU2CIZSOqZ9TyIInLTNI62vkuqR6qZsv8glWweb0,3293
76
+ bencher/example/inputs_1D/example_1_int_in_2_out_repeats.py,sha256=H-iUXIpeUdAhryLck9yuApaPxpVYYBQ9t6RiaQM1zCY,3214
77
+ bencher/example/inputs_1_float/example_1_float_0_cat_in_2_out.py,sha256=1wmXRshEm6EIQp-vrlwPrAUKsNcUzEXp_9A85yEKQ5g,4764
78
+ bencher/example/inputs_1_float/example_1_float_1_cat_in_2_out.py,sha256=HsMqSAGLdNqCT2XdAxRA8XFsXX53oXO9RB5eJHaatPA,4944
79
+ bencher/example/inputs_1_float/example_1_float_2_cat_in_2_out.py,sha256=mlzhPAZhjxk5kSsMKhAhU-PysPYKnbIfwLxpFz113nM,5287
80
+ bencher/example/inputs_1_float/example_1_float_3_cat_in_2_out.py,sha256=c7wuAvyafYQ9P2O6o-qB5EIcSlUrN-XIGS4tmHbu8eM,5603
81
+ bencher/example/inputs_2D/example_2_cat_in_4_out_repeats.py,sha256=FdNbido_7E3u9rfPpe0tJrZ54jvydsMmjkWsqigAzWM,3659
82
+ bencher/example/inputs_2_float/example_2_float_0_cat_in_2_out.py,sha256=0_J0-RovFoXbzbMp1Hj2tKeHJrI-jnk75BMBuKmOCQE,3460
83
+ bencher/example/inputs_2_float/example_2_float_1_cat_in_2_out.py,sha256=kAUna8-YG4u8wtyzStNhsW7PtiuCvM0QLnJ4U5xeAtc,4295
84
+ bencher/example/inputs_2_float/example_2_float_2_cat_in_2_out.py,sha256=E2GxwokltJBjSJFncB2teso4HnXuLZ4wCzYpJYPNU6U,4829
85
+ bencher/example/inputs_2_float/example_2_float_3_cat_in_2_out.py,sha256=mCJ3elfifQ8du01GB4QQo79J_83-0yA3QxDNLBzDHeE,5626
86
+ bencher/example/inputs_3_float/example_3_float_0_cat_in_2_out.py,sha256=AhSSMqsJr0wPMnwUYri9EI3le4Cve06xUfQ6PirkqF4,4186
87
+ bencher/example/inputs_3_float/example_3_float_1_cat_in_2_out.py,sha256=CGa9761oCnqqQzgP-2xF-QQGPlMN3eFDvTYh-NN5H9s,4867
88
+ bencher/example/inputs_3_float/example_3_float_2_cat_in_2_out.py,sha256=eSETL0MjPRPAuaxDqQmfN4P5hn-XBRFmGWM5z1--Bqw,5242
89
+ bencher/example/inputs_3_float/example_3_float_3_cat_in_2_out.py,sha256=U1aIY1bWvQTFmhFHOoAb4Qou96vlZF4Kh4gMINHsPnI,5596
90
+ bencher/example/meta/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
91
+ bencher/example/meta/example_meta.py,sha256=ZXW8LZ1DGs05RiZRHLrOx-qt9x10qL6v2tt7Ulay-mM,5549
92
+ bencher/example/meta/example_meta_cat.py,sha256=j3OCi1Yra47wrXOVr8epMYPGIXjQwdQoCcCICPmE2lo,609
93
+ bencher/example/meta/example_meta_float.py,sha256=Y-zo7QAZkpt3mQEE4guiPmRHmKjn6-y8D_AjWeGCqEs,598
94
+ bencher/example/meta/example_meta_levels.py,sha256=ZZ14r99z6cs73ZwvBJvDKdEVIdTyHzrWsenxRgFXfXQ,1410
95
+ bencher/example/meta/generate_examples.py,sha256=33zxIu1ikutm1QTl8H47h9NXL_yUKorTAasvK-5rxmU,5531
96
+ bencher/example/meta/generate_meta.py,sha256=KRqyGVWcgGXhuXSDUSjoyYdgt7RFRQmcIIUHAlN7vl0,7729
97
+ bencher/example/optuna/example_optuna.py,sha256=0zA6IIDWe7FM0rnYJ-FHF9GZtrhYdKHQTosUD2Raw0M,2338
98
+ bencher/example/shelved/example_float2D_scatter.py,sha256=z8ranMq8IcJ1yoVSFDncp3gw-yWG7X9lXLimXKpy5Ks,3372
99
+ bencher/example/shelved/example_float3D_cone.py,sha256=T3dkiEhjm6z3-Vs2SjCNWPKeHk8Bp4FbANE6yXYc_YM,2970
100
+ bencher/example/shelved/example_kwargs.py,sha256=ahWC3d1vQMS0bdYtZGEILyDGnT5ixR5nVHSnvqMgFL0,2462
101
+ bencher/plotting/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
102
+ bencher/plotting/plot_filter.py,sha256=M2pdrF-At8H6ylQ8g9FbXM4Jasj7L0SXBURMc617ff0,6571
103
+ bencher/plotting/plt_cnt_cfg.py,sha256=0P9KjVQSUfPY7Kh7UGAbTqihaTgnmLm3oZ5Nvf-pcjM,3193
104
+ bencher/results/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
105
+ bencher/results/bench_result.py,sha256=ehVRIv-Xeop9XYOCshsxcyAEdJ42b4R8JWHKCBOtvVg,7530
106
+ bencher/results/bench_result_base.py,sha256=PPz5cbBUGbKojHQN__R-sTvptgQbiGOxf1arnhavhIA,26024
107
+ bencher/results/dataset_result.py,sha256=ptBna7HBklx3bDMt0-SICxSXdnvijQ5wEYQKTcaXqN8,1022
108
+ bencher/results/explorer_result.py,sha256=G6ql7gLchHu-qzgdMxJgMohJkTTrIfYUeV_5c4tAr94,1001
109
+ bencher/results/float_formatter.py,sha256=sX6HNCyaXdHDxC8ybVUHwCJ3qOKbPUkBOplVIHtKWjM,1746
110
+ bencher/results/histogram_result.py,sha256=byjrbS6kssircVWEKCRFIpX-afQaKG3VyQse2bsqhXg,1328
111
+ bencher/results/laxtex_result.py,sha256=BL9iNgSoNpE8WTwW_OjVbYdYgRdlP27zv_nQ9PpwLds,2212
112
+ bencher/results/optuna_result.py,sha256=fDOYVkIK09zPYUpuYHF_1vLTv51mBuEJ9pW9bksifdA,10781
113
+ bencher/results/video_controls.py,sha256=E3fAxXctRVxiRyamadpKCMXanM5TTqw1tEYICS2LDLs,1146
114
+ bencher/results/video_result.py,sha256=e7NvMuEtEq5tCCpvggfPfen7F4aI10Tbh7gyUvpOsGI,1338
115
+ bencher/results/video_summary.py,sha256=CVJqiGedogmu4cvuqH0esTmABJhFSZy7e5RtJimpEBg,8800
116
+ bencher/results/volume_result.py,sha256=GHBenboBQtDeECXDFhXd6cKijqZsJM17m6wEwa_uItI,2982
117
+ bencher/results/composable_container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
118
+ bencher/results/composable_container/composable_container_base.py,sha256=gmlQl3NQ3LWIfH15neLoZMNos6hbu3SklslfcFDAacA,2778
119
+ bencher/results/composable_container/composable_container_dataframe.py,sha256=ZbFaQSo4UsRxY8NUdJPjNFW3_kzlm8jtWuoLf8y_t8U,1789
120
+ bencher/results/composable_container/composable_container_panel.py,sha256=HrOoeGB0y0jGQcxcci_M82ftsvklLkJgo-4SjDBJCks,1232
121
+ bencher/results/composable_container/composable_container_video.py,sha256=yLfGRIswSHHWfFwVFBVz31wzKB9x-3bTfMtr-BqIyzk,8672
122
+ bencher/results/holoview_results/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
123
+ bencher/results/holoview_results/bar_result.py,sha256=HY7fTbsyhckYepsG4-bwG2JVS1kTADHixllU_lwjexg,3339
124
+ bencher/results/holoview_results/curve_result.py,sha256=9_dOjzqX6Iq9112wiGYesPo4V29pO2KAZuIFyEg4qiE,4752
125
+ bencher/results/holoview_results/heatmap_result.py,sha256=fJLKSXP5RirFwxNN8kY5X7mP5zJF6ZC7uTNXEUuARUw,13476
126
+ bencher/results/holoview_results/holoview_result.py,sha256=SGJaBEdPd_k6unTqcKMXorHyHzN7HSWU1CM9HsW47Ro,13558
127
+ bencher/results/holoview_results/line_result.py,sha256=I3TPHHFxEnL8NP2qj7h8y5hNtI84zkOeDWT-s_-XZoY,10010
128
+ bencher/results/holoview_results/scatter_result.py,sha256=e7VjP2i8QAClv6NknaSxtzIyav40VS1XL6L3BedQRZg,4681
129
+ bencher/results/holoview_results/surface_result.py,sha256=AIURc8fFLEWe2WhKAk3Ji4axuKa6etX4XKHCsrcb1DE,6436
130
+ bencher/results/holoview_results/table_result.py,sha256=i7mwn1EUBld1WFGyutZMdAT8UQFoWAgQJPOkhb5SSLI,503
131
+ bencher/results/holoview_results/tabulator_result.py,sha256=-_iOsNFaykvrFu9TPVhaKoZgYJh2SH3CpVXfh07Wu-Q,749
132
+ bencher/results/holoview_results/distribution_result/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
133
+ bencher/results/holoview_results/distribution_result/box_whisker_result.py,sha256=DOqNEe-t1BjD81R7F8MMSn_6SgBmGC7f5p2Lfban59E,3100
134
+ bencher/results/holoview_results/distribution_result/distribution_result.py,sha256=85MBCCUtUlUvyu7a3FEGFaEH6N-atZqHmZjXOwKyr5c,4270
135
+ bencher/results/holoview_results/distribution_result/scatter_jitter_result.py,sha256=8SGZEsQasv_eMqgGbJIWb4LhXeT2KVGYaSlYukcDMpg,3858
136
+ bencher/results/holoview_results/distribution_result/violin_result.py,sha256=pJdYqcCNDChEBQCPBT6Dxsw9GBFOoskWOlSCicsQFoE,3054
137
+ bencher/variables/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
138
+ bencher/variables/inputs.py,sha256=v2P6Dfqu9pLGsXjor8mGDVZjrJB5t5e3DP2gyyB2JAY,10815
139
+ bencher/variables/parametrised_sweep.py,sha256=fxjKOQ2x5xuCyi0kO1_XS9bXiib1bjThhvpulZPeyv8,7802
140
+ bencher/variables/results.py,sha256=Wq14e8rAj5mcK22325wcaeTMjgZ6JuduqceAHItHFY8,7750
141
+ bencher/variables/sweep_base.py,sha256=gfEhKvsb16ZLbe38JewZqu0AMOHpsqwRbZbt-aCg9Bc,6258
142
+ bencher/variables/time.py,sha256=zcRS5p4ZkFjMta9nZMEuWv86rLnPkUSqyO69QwI5q3E,3142
143
+ resource/bencher,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
144
+ holobench-1.42.0.dist-info/METADATA,sha256=auu3GtotG0g-PbXaghkNRlzPrJL47vs22KFkHR162TM,6675
145
+ holobench-1.42.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
146
+ holobench-1.42.0.dist-info/licenses/LICENSE,sha256=dSHXTdRY4Y7qGFMv63UksV700iff7iE-p7GGs6Sbnvo,1065
147
+ holobench-1.42.0.dist-info/RECORD,,
@@ -1,106 +0,0 @@
1
- import bencher as bch
2
-
3
- from bencher.example.example_image import BenchPolygons
4
-
5
-
6
- class BenchComposableContainerImage(BenchPolygons):
7
- compose_method = bch.EnumSweep(bch.ComposeType)
8
- labels = bch.BoolSweep()
9
- num_frames = bch.IntSweep(default=5, bounds=[1, 100])
10
- polygon_vid = bch.ResultVideo()
11
-
12
- def __call__(self, **kwargs):
13
- self.update_params_from_kwargs(**kwargs)
14
- var_name = None
15
- var_value = None
16
-
17
- if self.labels:
18
- var_name = "sides"
19
- var_value = self.sides
20
- vr = bch.ComposableContainerVideo()
21
- for i in range(self.num_frames):
22
- res = super().__call__(start_angle=i)
23
- print(res)
24
- vr.append(res["polygon"])
25
- self.polygon_vid = vr.to_video(
26
- bch.RenderCfg(
27
- compose_method=self.compose_method,
28
- var_name=var_name,
29
- var_value=var_value,
30
- max_frame_duration=1.0 / 20.0,
31
- )
32
- )
33
- return self.get_results_values_as_dict()
34
-
35
-
36
- class BenchComposableContainerVideo(bch.ParametrizedSweep):
37
- unequal_length = bch.BoolSweep()
38
- compose_method = bch.EnumSweep(bch.ComposeType)
39
- labels = bch.BoolSweep()
40
- polygon_vid = bch.ResultVideo()
41
-
42
- def __call__(self, **kwargs):
43
- self.update_params_from_kwargs(**kwargs)
44
- vr = bch.ComposableContainerVideo()
45
- for i in range(3, 5):
46
- num_frames = i * 10 if self.unequal_length else 5
47
- res = BenchComposableContainerImage().__call__(
48
- compose_method=bch.ComposeType.sequence, sides=i, num_frames=num_frames
49
- )
50
- vr.append(res["polygon_vid"])
51
-
52
- self.polygon_vid = vr.to_video(bch.RenderCfg(compose_method=kwargs.get("compose_method")))
53
- return self.get_results_values_as_dict()
54
-
55
-
56
- def example_composable_container_image(
57
- run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None
58
- ) -> bch.Bench:
59
- bench = BenchComposableContainerImage().to_bench(run_cfg, report)
60
- bench.result_vars = ["polygon_vid"]
61
- # bench.add_plot_callback(bch.BenchResult.to_panes)
62
- # bench.add_plot_callback(bch.BenchResult.to_video_grid, result_types=(bch.ResultVideo))
63
- # bench.add_plot_callback(bch.BenchResult.to_video_summary, result_types=(bch.ResultVideo))
64
- # bench.plot_sweep(input_vars=["compose_method", "labels"])
65
-
66
- bench.plot_sweep(input_vars=["compose_method"])
67
-
68
- # bench.compose_
69
- # bench.plot_sweep(
70
- # input_vars=[bch.p("num_frames", [2, 8, 20])],
71
- # const_vars=dict(compose_method=bch.ComposeType.sequence),
72
- # )
73
-
74
- return bench
75
-
76
-
77
- def example_composable_container_video(
78
- run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None
79
- ) -> bch.Bench:
80
- bench = BenchComposableContainerVideo().to_bench(run_cfg, report)
81
-
82
- bench.result_vars = ["polygon_vid"]
83
- bench.add_plot_callback(bch.BenchResult.to_panes)
84
- bench.add_plot_callback(bch.BenchResult.to_video_grid, result_types=(bch.ResultVideo))
85
- bench.add_plot_callback(bch.BenchResult.to_video_summary, result_types=(bch.ResultVideo))
86
- bench.plot_sweep(input_vars=["compose_method", "labels"], const_vars=dict(unequal_length=True))
87
-
88
- res = bench.plot_sweep(
89
- input_vars=[],
90
- const_vars=dict(unequal_length=False, compose_method=bch.ComposeType.sequence),
91
- plot_callbacks=False,
92
- )
93
-
94
- bench.report.append(res.to_video_grid())
95
-
96
- return bench
97
-
98
-
99
- if __name__ == "__main__":
100
- ex_run_cfg = bch.BenchRunCfg()
101
- ex_run_cfg.cache_samples = False
102
- # ex_run_cfg.level = 2
103
- ex_report = bch.BenchReport()
104
- example_composable_container_image(ex_run_cfg, report=ex_report)
105
- # example_composable_container_video(ex_run_cfg, report=ex_report)
106
- ex_report.show()
@@ -1,37 +0,0 @@
1
- import bencher as bch
2
-
3
-
4
- class Square(bch.ParametrizedSweep):
5
- """An example of a datatype with an integer and float parameter"""
6
-
7
- x = bch.FloatSweep(default=0, bounds=[0, 6])
8
-
9
- result = bch.ResultVar("ul", doc="Square of x")
10
-
11
- def __call__(self, **kwargs) -> dict:
12
- self.update_params_from_kwargs(**kwargs)
13
- self.result = self.x * self.x
14
- return self.get_results_values_as_dict()
15
-
16
-
17
- def example_levels2(run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None) -> bch.Bench:
18
- """This example shows how to define a custom set of value to sample from instead of a uniform sweep
19
-
20
- Args:
21
- run_cfg (BenchRunCfg): configuration of how to perform the param sweep
22
-
23
- Returns:
24
- Bench: results of the parameter sweep
25
- """
26
-
27
- bench = Square().to_bench(run_cfg=run_cfg, report=report)
28
-
29
- # These are all equivalent
30
- bench.plot_sweep(input_vars=[Square.param.x.with_level(run_cfg.level, 3)])
31
- bench.plot_sweep(input_vars=[bch.p("x", max_level=3)])
32
-
33
- return bench
34
-
35
-
36
- if __name__ == "__main__":
37
- example_levels2(bch.BenchRunCfg(level=4)).report.show()
@@ -1,62 +0,0 @@
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
- print(index, repeat)
24
- return self.data[index][repeat - 1]
25
-
26
-
27
- class Example1D(bch.ParametrizedSweep):
28
- index = bch.IntSweep(default=0, bounds=[0, 5], doc="Input angle", units="rad", samples=30)
29
- output = bch.ResultVar(units="v", doc="sin of theta")
30
-
31
- def __init__(self, **params):
32
- super().__init__(**params)
33
- self.data1 = DataSource()
34
-
35
- def __call__(self, **kwargs):
36
- self.update_params_from_kwargs(**kwargs)
37
- self.output = self.data1.call(self.index)
38
- return super().__call__(**kwargs)
39
-
40
-
41
- def example_1_in_1_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
- return bench
48
-
49
-
50
- if __name__ == "__main__":
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()
@@ -1,63 +0,0 @@
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()
@@ -1,61 +0,0 @@
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_repeats(
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
-
46
- from importlib.metadata import version
47
-
48
- print(version("holobench"))
49
- if run_cfg is None:
50
- run_cfg = bch.BenchRunCfg()
51
- run_cfg.repeats = 4
52
- bench = Example1D().to_bench(run_cfg, report)
53
- bench.plot_sweep()
54
- return bench
55
-
56
-
57
- if __name__ == "__main__":
58
- run_config = bch.BenchRunCfg()
59
- reprt = bch.BenchReport()
60
- example_1_in_2_out_repeats(run_config, reprt)
61
- reprt.show()