holobench 1.40.0__tar.gz → 1.40.1__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.
Files changed (112) hide show
  1. {holobench-1.40.0 → holobench-1.40.1}/PKG-INFO +1 -1
  2. {holobench-1.40.0 → holobench-1.40.1}/bencher/bench_cfg.py +24 -7
  3. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/meta/generate_examples.py +0 -4
  4. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/meta/generate_meta.py +27 -3
  5. holobench-1.40.1/bencher/results/laxtex_result.py +60 -0
  6. {holobench-1.40.0 → holobench-1.40.1}/pyproject.toml +1 -1
  7. {holobench-1.40.0 → holobench-1.40.1}/.gitignore +0 -0
  8. {holobench-1.40.0 → holobench-1.40.1}/LICENSE +0 -0
  9. {holobench-1.40.0 → holobench-1.40.1}/README.md +0 -0
  10. {holobench-1.40.0 → holobench-1.40.1}/bencher/__init__.py +0 -0
  11. {holobench-1.40.0 → holobench-1.40.1}/bencher/bench_plot_server.py +0 -0
  12. {holobench-1.40.0 → holobench-1.40.1}/bencher/bench_report.py +0 -0
  13. {holobench-1.40.0 → holobench-1.40.1}/bencher/bench_runner.py +0 -0
  14. {holobench-1.40.0 → holobench-1.40.1}/bencher/bencher.py +0 -0
  15. {holobench-1.40.0 → holobench-1.40.1}/bencher/caching.py +0 -0
  16. {holobench-1.40.0 → holobench-1.40.1}/bencher/class_enum.py +0 -0
  17. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/__init__.py +0 -0
  18. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/benchmark_data.py +0 -0
  19. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_all.py +0 -0
  20. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_categorical.py +0 -0
  21. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_composable_container.py +0 -0
  22. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_composable_container2.py +0 -0
  23. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_consts.py +0 -0
  24. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_custom_sweep.py +0 -0
  25. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_custom_sweep2.py +0 -0
  26. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_dataframe.py +0 -0
  27. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_docs.py +0 -0
  28. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_filepath.py +0 -0
  29. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_float3D.py +0 -0
  30. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_float_cat.py +0 -0
  31. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_floats.py +0 -0
  32. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_floats2D.py +0 -0
  33. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_holosweep.py +0 -0
  34. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_holosweep_objects.py +0 -0
  35. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_holosweep_tap.py +0 -0
  36. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_image.py +0 -0
  37. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_image1.py +0 -0
  38. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_levels.py +0 -0
  39. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_levels2.py +0 -0
  40. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_pareto.py +0 -0
  41. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_publish.py +0 -0
  42. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_rerun.py +0 -0
  43. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_rerun2.py +0 -0
  44. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_sample_cache.py +0 -0
  45. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_sample_cache_context.py +0 -0
  46. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_simple.py +0 -0
  47. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_simple_bool.py +0 -0
  48. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_simple_cat.py +0 -0
  49. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_simple_float.py +0 -0
  50. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_simple_float2d.py +0 -0
  51. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_strings.py +0 -0
  52. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_time_event.py +0 -0
  53. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_video.py +0 -0
  54. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/example_workflow.py +0 -0
  55. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/experimental/example_bokeh_plotly.py +0 -0
  56. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/experimental/example_hover_ex.py +0 -0
  57. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/experimental/example_hvplot_explorer.py +0 -0
  58. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/experimental/example_interactive.py +0 -0
  59. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/experimental/example_streamnd.py +0 -0
  60. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/experimental/example_streams.py +0 -0
  61. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/experimental/example_template.py +0 -0
  62. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/experimental/example_updates.py +0 -0
  63. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/experimental/example_vector.py +0 -0
  64. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/inputs_0D/example_0_in_1_out.py +0 -0
  65. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/inputs_0D/example_0_in_2_out.py +0 -0
  66. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/inputs_1D/example1d_common.py +0 -0
  67. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/inputs_1D/example_1_in_1_out.py +0 -0
  68. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/inputs_1D/example_1_in_2_out.py +0 -0
  69. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/inputs_1D/example_1_in_2_out_repeats.py +0 -0
  70. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/meta/__init__.py +0 -0
  71. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/meta/example_meta.py +0 -0
  72. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/meta/example_meta_cat.py +0 -0
  73. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/meta/example_meta_float.py +0 -0
  74. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/meta/example_meta_levels.py +0 -0
  75. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/optuna/example_optuna.py +0 -0
  76. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/shelved/example_float2D_scatter.py +0 -0
  77. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/shelved/example_float3D_cone.py +0 -0
  78. {holobench-1.40.0 → holobench-1.40.1}/bencher/example/shelved/example_kwargs.py +0 -0
  79. {holobench-1.40.0 → holobench-1.40.1}/bencher/flask_server.py +0 -0
  80. {holobench-1.40.0 → holobench-1.40.1}/bencher/job.py +0 -0
  81. {holobench-1.40.0 → holobench-1.40.1}/bencher/optuna_conversions.py +0 -0
  82. {holobench-1.40.0 → holobench-1.40.1}/bencher/plotting/__init__.py +0 -0
  83. {holobench-1.40.0 → holobench-1.40.1}/bencher/plotting/plot_filter.py +0 -0
  84. {holobench-1.40.0 → holobench-1.40.1}/bencher/plotting/plt_cnt_cfg.py +0 -0
  85. {holobench-1.40.0 → holobench-1.40.1}/bencher/results/__init__.py +0 -0
  86. {holobench-1.40.0 → holobench-1.40.1}/bencher/results/bench_result.py +0 -0
  87. {holobench-1.40.0 → holobench-1.40.1}/bencher/results/bench_result_base.py +0 -0
  88. {holobench-1.40.0 → holobench-1.40.1}/bencher/results/composable_container/__init__.py +0 -0
  89. {holobench-1.40.0 → holobench-1.40.1}/bencher/results/composable_container/composable_container_base.py +0 -0
  90. {holobench-1.40.0 → holobench-1.40.1}/bencher/results/composable_container/composable_container_dataframe.py +0 -0
  91. {holobench-1.40.0 → holobench-1.40.1}/bencher/results/composable_container/composable_container_panel.py +0 -0
  92. {holobench-1.40.0 → holobench-1.40.1}/bencher/results/composable_container/composable_container_video.py +0 -0
  93. {holobench-1.40.0 → holobench-1.40.1}/bencher/results/dataset_result.py +0 -0
  94. {holobench-1.40.0 → holobench-1.40.1}/bencher/results/float_formatter.py +0 -0
  95. {holobench-1.40.0 → holobench-1.40.1}/bencher/results/holoview_result.py +0 -0
  96. {holobench-1.40.0 → holobench-1.40.1}/bencher/results/hvplot_result.py +0 -0
  97. {holobench-1.40.0 → holobench-1.40.1}/bencher/results/optuna_result.py +0 -0
  98. {holobench-1.40.0 → holobench-1.40.1}/bencher/results/panel_result.py +0 -0
  99. {holobench-1.40.0 → holobench-1.40.1}/bencher/results/plotly_result.py +0 -0
  100. {holobench-1.40.0 → holobench-1.40.1}/bencher/results/video_result.py +0 -0
  101. {holobench-1.40.0 → holobench-1.40.1}/bencher/results/video_summary.py +0 -0
  102. {holobench-1.40.0 → holobench-1.40.1}/bencher/utils.py +0 -0
  103. {holobench-1.40.0 → holobench-1.40.1}/bencher/utils_rerun.py +0 -0
  104. {holobench-1.40.0 → holobench-1.40.1}/bencher/variables/__init__.py +0 -0
  105. {holobench-1.40.0 → holobench-1.40.1}/bencher/variables/inputs.py +0 -0
  106. {holobench-1.40.0 → holobench-1.40.1}/bencher/variables/parametrised_sweep.py +0 -0
  107. {holobench-1.40.0 → holobench-1.40.1}/bencher/variables/results.py +0 -0
  108. {holobench-1.40.0 → holobench-1.40.1}/bencher/variables/sweep_base.py +0 -0
  109. {holobench-1.40.0 → holobench-1.40.1}/bencher/variables/time.py +0 -0
  110. {holobench-1.40.0 → holobench-1.40.1}/bencher/video_writer.py +0 -0
  111. {holobench-1.40.0 → holobench-1.40.1}/bencher/worker_job.py +0 -0
  112. {holobench-1.40.0 → holobench-1.40.1}/resource/bencher +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: holobench
3
- Version: 1.40.0
3
+ Version: 1.40.1
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
@@ -8,15 +8,13 @@ from typing import List
8
8
  import param
9
9
  from str2bool import str2bool
10
10
  import panel as pn
11
-
11
+ from datetime import datetime
12
12
 
13
13
  from bencher.variables.sweep_base import hash_sha1, describe_variable
14
14
  from bencher.variables.time import TimeSnapshot, TimeEvent
15
15
  from bencher.variables.results import OptDir
16
16
  from bencher.job import Executors
17
- from datetime import datetime
18
-
19
- # from bencher.results.bench_result import BenchResult
17
+ from bencher.results.laxtex_result import to_latex
20
18
 
21
19
 
22
20
  class BenchPlotSrvCfg(param.Parameterized):
@@ -344,13 +342,32 @@ class BenchCfg(BenchRunCfg):
344
342
  def inputs_as_str(self) -> List[str]:
345
343
  return [i.name for i in self.input_vars]
346
344
 
347
- def describe_sweep(self, width: int = 800, accordion=True) -> pn.pane.Markdown:
345
+ def to_latex(self):
346
+ return to_latex(self)
347
+
348
+ def describe_sweep(self, width: int = 800, accordion=True) -> pn.pane.Markdown | pn.Column:
348
349
  """Produce a markdown summary of the sweep settings"""
349
350
 
351
+ latex = self.to_latex()
350
352
  desc = pn.pane.Markdown(self.describe_benchmark(), width=width)
351
353
  if accordion:
352
- return pn.Accordion(("Data Collection Parameters", desc))
353
- return desc
354
+ desc = pn.Accordion(("Data Collection Parameters", desc))
355
+
356
+ sentence = self.sweep_sentence()
357
+ if latex is not None:
358
+ return pn.Column(sentence, latex, desc)
359
+ return pn.Column(sentence, latex, desc)
360
+
361
+ def sweep_sentence(self):
362
+ inputs = " by ".join([iv.name for iv in self.all_vars])
363
+
364
+ all_vars_lens = [len(iv.values()) for iv in reversed(self.all_vars)]
365
+ if len(all_vars_lens) == 1:
366
+ all_vars_lens.append(1)
367
+ result_sizes = "x".join([str(iv) for iv in all_vars_lens])
368
+ results = ", ".join([rv.name for rv in self.result_vars])
369
+
370
+ return f"Sweeping {inputs} to generate a {result_sizes} result dataframe containing {results}. "
354
371
 
355
372
  def describe_benchmark(self) -> str:
356
373
  """Generate a string summary of the inputs and results from a BenchCfg
@@ -48,7 +48,3 @@ if __name__ == "__main__":
48
48
  convert_example_to_jupyter_notebook(
49
49
  "/workspaces/bencher/bencher/example/inputs_1D/example_1_in_2_out_repeats.py", "1D"
50
50
  )
51
-
52
- convert_example_to_jupyter_notebook(
53
- "/workspaces/bencher/bencher/example/example_simple_float.py", "1D"
54
- )
@@ -39,7 +39,7 @@ class BenchMetaGen(bch.ParametrizedSweep):
39
39
  inputs_vars_float = [
40
40
  "float1",
41
41
  "float2",
42
- "float3",
42
+ bch.p("float3", max_level=3),
43
43
  "sigma",
44
44
  ]
45
45
 
@@ -107,10 +107,9 @@ def example_meta(run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None
107
107
  description="""## All Combinations of Variable Sweeps and Resulting Plots
108
108
  This uses bencher to display all the combinations of plots bencher is able to produce""",
109
109
  input_vars=[
110
- bch.p("float_vars", [0, 1, 2, 3]),
110
+ bch.p("float_vars", [0, 1]),
111
111
  "categorical_vars",
112
112
  bch.p("sample_with_repeats", [1, 20]),
113
- # "sample_over_time",
114
113
  ],
115
114
  const_vars=[
116
115
  # BenchMeta.param.float_vars.with_const(1),
@@ -119,6 +118,31 @@ This uses bencher to display all the combinations of plots bencher is able to pr
119
118
  # BenchMeta.param.sample_over_time.with_const(True),
120
119
  ],
121
120
  )
121
+ bench.plot_sweep(
122
+ title="Meta Bench",
123
+ description="""## All Combinations of Variable Sweeps and Resulting Plots
124
+ This uses bencher to display all the combinations of plots bencher is able to produce""",
125
+ input_vars=[
126
+ bch.p("float_vars", [2, 3]),
127
+ "categorical_vars",
128
+ ],
129
+ )
130
+
131
+ # bench.plot_sweep(
132
+ # title="Meta Bench",
133
+ # description="""## All Combinations of Variable Sweeps and Resulting Plots
134
+ # This uses bencher to display all the combinations of plots bencher is able to produce""",
135
+ # input_vars=[
136
+ # bch.p("float_vars", [2, 3]),
137
+ # "categorical_vars",
138
+ # ],
139
+ # const_vars=[
140
+ # dict(level=3)
141
+ # # BenchMeta.param.sample_with_repeats.with_const(2),
142
+ # # BenchMeta.param.categorical_vars.with_const(2),
143
+ # # BenchMeta.param.sample_over_time.with_const(True),
144
+ # ],
145
+ # )
122
146
 
123
147
  return bench
124
148
 
@@ -0,0 +1,60 @@
1
+ from __future__ import annotations
2
+ import panel as pn
3
+ from panel.pane import LaTeX
4
+ from typing import Optional
5
+
6
+ pn.extension("mathjax")
7
+
8
+
9
+ def latex_text(var):
10
+ var_str = str(var)
11
+ return r"\text{" + var_str.replace("_", " ") + r"} \\"
12
+
13
+
14
+ def input_var_to_latex(input_var):
15
+ vals = input_var.values()
16
+ displayed_vals = vals
17
+ if len(vals) > 5:
18
+ displayed_vals = [vals[i] for i in [0, 1, 0, -2, -1]]
19
+ displayed_vals[2] = "⋮"
20
+ v = r"\\ ".join([str(va) for va in displayed_vals])
21
+
22
+ latex_str = r"""\begin{array}{c}"""
23
+ latex_str += latex_text(input_var.name)
24
+ latex_str += f"{len(vals)}" + r"\times1 \\"
25
+ latex_str += r"\left[ \begin{array}{c}"
26
+ latex_str += f"{v} "
27
+ latex_str += r"\end{array} \right] \end{array}"
28
+ return latex_str
29
+
30
+
31
+ def result_var_to_latex(bench_cfg):
32
+ latex_str = r"\begin{array}{c}"
33
+ sizes = [str(len(i.values())) for i in bench_cfg.all_vars]
34
+ if len(sizes) == 1:
35
+ sizes.insert(0, "1")
36
+ sizes_str = r"\times".join(reversed(sizes))
37
+ latex_str += sizes_str + r"\\ of \\"
38
+ latex_str += r" \left[\begin{array}{cc}"
39
+
40
+ for rv in bench_cfg.result_vars:
41
+ latex_str += latex_text(rv.name)
42
+ latex_str += r"\end{array} \right]"
43
+ latex_str += r"\end{array}"
44
+ return latex_str
45
+
46
+
47
+ def to_latex(bench_cfg) -> Optional[pn.pane.LaTeX]:
48
+ if len(bench_cfg.all_vars) > 0:
49
+ latex_str = r"\["
50
+ for i, iv in enumerate(bench_cfg.all_vars):
51
+ latex_str += input_var_to_latex(iv)
52
+ if i != len(bench_cfg.all_vars) - 1:
53
+ latex_str += r"\bigtimes"
54
+
55
+ latex_str += r"\rightarrow\quad"
56
+ latex_str += result_var_to_latex(bench_cfg)
57
+ latex_str += r"\]"
58
+ # underscore represents subscript, so replace underscore with large space character \;
59
+ return LaTeX(latex_str.replace("_", r"\;"))
60
+ return None
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "holobench"
3
- version = "1.40.0"
3
+ version = "1.40.1"
4
4
 
5
5
  authors = [{ name = "Austin Gregg-Smith", email = "blooop@gmail.com" }]
6
6
  description = "A package for benchmarking the performance of arbitrary functions"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes