holobench 1.2.1__py3-none-any.whl → 1.2.2__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.
@@ -78,12 +78,12 @@ class BenchMeta(bch.ParametrizedSweep):
78
78
  """This class uses bencher to display the multidimensional types bencher can represent"""
79
79
 
80
80
  float_vars = bch.IntSweep(
81
- default=1, bounds=(0, 3), doc="The number of floating point variables that are swept"
81
+ default=1, bounds=(0, 4), doc="The number of floating point variables that are swept"
82
82
  )
83
83
  categorical_vars = bch.IntSweep(
84
84
  default=1, bounds=(0, 3), doc="The number of categorical variables that are swept"
85
85
  )
86
- sample_with_repeats = bch.IntSweep(default=1, bounds=(1, 2))
86
+ sample_with_repeats = bch.IntSweep(default=1, bounds=(1, 10))
87
87
 
88
88
  sample_over_time = bch.BoolSweep(default=False)
89
89
 
@@ -143,16 +143,16 @@ class BenchMeta(bch.ParametrizedSweep):
143
143
  def example_meta(
144
144
  run_cfg: bch.BenchRunCfg = bch.BenchRunCfg(), report: bch.BenchReport = bch.BenchReport()
145
145
  ) -> bch.Bench:
146
- bench = bch.Bench("bench_meta", BenchMeta(), report=report, run_cfg=run_cfg)
146
+ bench = BenchMeta().to_bench(run_cfg, report)
147
147
 
148
148
  bench.plot_sweep(
149
149
  title="Meta Bench",
150
150
  description="""## All Combinations of Variable Sweeps and Resulting Plots
151
151
  This uses bencher to display all the combinatios of plots bencher is able to produce""",
152
152
  input_vars=[
153
- BenchMeta.param.float_vars,
153
+ BenchMeta.param.float_vars.with_sample_values([0, 1, 2, 3]),
154
154
  BenchMeta.param.categorical_vars,
155
- BenchMeta.param.sample_with_repeats,
155
+ BenchMeta.param.sample_with_repeats.with_sample_values([1, 2]),
156
156
  # BenchMeta.param.sample_over_time,
157
157
  ],
158
158
  const_vars=[
@@ -0,0 +1,25 @@
1
+ import bencher as bch
2
+ from bencher.example.meta.example_meta import BenchMeta
3
+
4
+
5
+ def example_meta_cat(
6
+ run_cfg: bch.BenchRunCfg = bch.BenchRunCfg(), report: bch.BenchReport = bch.BenchReport()
7
+ ) -> bch.Bench:
8
+ bench = BenchMeta().to_bench(run_cfg, report)
9
+
10
+ bench.plot_sweep(
11
+ title="Sweeping Categorical Variables",
12
+ input_vars=[
13
+ BenchMeta.param.categorical_vars.with_sample_values([1, 2, 3]),
14
+ BenchMeta.param.sample_with_repeats.with_sample_values([1, 2]),
15
+ ],
16
+ const_vars=[
17
+ BenchMeta.param.float_vars.with_const(0),
18
+ ],
19
+ )
20
+
21
+ return bench
22
+
23
+
24
+ if __name__ == "__main__":
25
+ example_meta_cat().report.show()
@@ -0,0 +1,23 @@
1
+ import bencher as bch
2
+ from bencher.example.meta.example_meta import BenchMeta
3
+
4
+
5
+ def example_meta_float(
6
+ run_cfg: bch.BenchRunCfg = bch.BenchRunCfg(), report: bch.BenchReport = bch.BenchReport()
7
+ ) -> bch.Bench:
8
+ bench = BenchMeta().to_bench(run_cfg, report)
9
+
10
+ bench.plot_sweep(
11
+ title="Sweeping Floating Point Variables",
12
+ input_vars=[BenchMeta.param.float_vars.with_sample_values([1, 2, 3, 4])],
13
+ const_vars=[
14
+ BenchMeta.param.categorical_vars.with_const(0),
15
+ BenchMeta.param.level.with_const(3),
16
+ ],
17
+ )
18
+
19
+ return bench
20
+
21
+
22
+ if __name__ == "__main__":
23
+ example_meta_float().report.show()
@@ -1,11 +1,11 @@
1
1
  import bencher as bch
2
- from bencher.example.example_meta import BenchMeta
2
+ from bencher.example.meta.example_meta import BenchMeta
3
3
 
4
4
 
5
5
  def example_meta_levels(
6
6
  run_cfg: bch.BenchRunCfg = bch.BenchRunCfg(), report: bch.BenchReport = bch.BenchReport()
7
7
  ) -> bch.Bench:
8
- bench = bch.Bench("bench_meta", BenchMeta(), report=report, run_cfg=run_cfg)
8
+ bench = BenchMeta().to_bench(run_cfg, report)
9
9
 
10
10
  bench.plot_sweep(
11
11
  title="Using Levels to define sample density",
@@ -57,6 +57,10 @@ class BenchResultBase(OptunaResult):
57
57
  Returns:
58
58
  hv.Dataset: results in the form of a holoviews dataset
59
59
  """
60
+
61
+ if reduce == ReduceType.NONE:
62
+ kdims = [i.name for i in self.bench_cfg.all_vars]
63
+ return hv.Dataset(self.to_dataset(reduce, result_var), kdims=kdims)
60
64
  return hv.Dataset(self.to_dataset(reduce, result_var))
61
65
 
62
66
  def to_dataset(
@@ -16,6 +16,7 @@ from bencher.variables.results import (
16
16
  ResultContainer,
17
17
  ResultReference,
18
18
  )
19
+
19
20
  from uuid import uuid4
20
21
 
21
22
 
@@ -207,7 +208,12 @@ class ParametrizedSweep(Parameterized):
207
208
  def gen_image_path(self, image_name: str, filetype=".png") -> str:
208
209
  return self.gen_path(image_name, "img", filetype)
209
210
 
210
- def to_bench(self, run_cfg=None, report=None):
211
+ def to_bench(self, run_cfg=None, report=None, name: str = None):
211
212
  from bencher import Bench
212
213
 
213
- return Bench(self.name, self, run_cfg=run_cfg, report=report)
214
+ assert isinstance(self, ParametrizedSweep)
215
+
216
+ if name is None:
217
+ name = self.name
218
+
219
+ return Bench(name, self, run_cfg=run_cfg, report=report)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: holobench
3
- Version: 1.2.1
3
+ Version: 1.2.2
4
4
  Summary: A package for benchmarking the performance of arbitrary functions
5
5
  Author-email: Austin Gregg-Smith <blooop@gmail.com>
6
6
  Requires-Python: >=3.10
@@ -23,8 +23,6 @@ bencher/example/example_holosweep_objects.py,sha256=vHuAtkM1VrJelHOazn_SJfzxNywK
23
23
  bencher/example/example_holosweep_tap.py,sha256=3ayQ0bTj_XWP_92ifQJAhe1whwPAj_xWHPkzC7fvqAY,4540
24
24
  bencher/example/example_image.py,sha256=xB1Y3J1kkOaJV--SXAEU3pfhZtXUo1oSIcfT1N9L-OE,2734
25
25
  bencher/example/example_levels.py,sha256=rpSNB571yfMnT7iO66Ds-DPGHWzOTM9FLMNfSetJdHY,6896
26
- bencher/example/example_meta.py,sha256=MAoaOMueLEi7QLY5iQwRjeIJvGhSBo2pOTYCgKh8zUc,5704
27
- bencher/example/example_meta_levels.py,sha256=6qR36qVJ6WBXLm9OJU01BGiT-Se9zi2OPlSh_xS-SdI,1449
28
26
  bencher/example/example_pareto.py,sha256=yyAg8Vb-5sgsS6LkYKT7T5Evcfg69FlCqCakUippSmU,2687
29
27
  bencher/example/example_sample_cache.py,sha256=7gf1BJ63VAgdqNuNXkbL9-jeTeC3kXA_PY9yG3ulTz0,4200
30
28
  bencher/example/example_sample_cache_context.py,sha256=IAUBbL78QM20R8evaq7L8I-xPxFDFykF1Gk1y2Ru1W0,4063
@@ -45,6 +43,10 @@ bencher/example/experimental/example_streams.py,sha256=rrTmcmxDlirGoyTbJ4LT4fBIA
45
43
  bencher/example/experimental/example_template.py,sha256=XdIVS9RtLdE5GNnerWiZMXvP7n17lzuc_YTLqJTwb6Q,1172
46
44
  bencher/example/experimental/example_updates.py,sha256=rF4UgWY-CW6ohNtOpQklTuwbwVRvEM5j6edZOiMkspQ,1835
47
45
  bencher/example/experimental/example_vector.py,sha256=3o_1dA4dc2HL6uIEvDAcvLPVJB8jgkq1QZ3BQIL-LEo,3118
46
+ bencher/example/meta/example_meta.py,sha256=OpresXooPvkSVI3mfExqiATyGvd3o5x-dmIjhTH5Zf4,5734
47
+ bencher/example/meta/example_meta_cat.py,sha256=YKVUiZ7M1tFFYgUTVQZeOe-1bnmxOjLdWy3nmCoyEe0,693
48
+ bencher/example/meta/example_meta_float.py,sha256=GjfO1HfbCb0zscZ83U3PpD8QNffnsx1ZVC5I3hrJJd8,653
49
+ bencher/example/meta/example_meta_levels.py,sha256=HNkb7Qej3rlf3blp2XoV-Od4c6sgRoM9aIQnBI5hv9I,1423
48
50
  bencher/example/mortgage/example_investment.py,sha256=agWmuFAt3fDimGAcgJBNIQO0OBA1w0ssotuyvWaKREQ,2025
49
51
  bencher/example/mortgage/example_mortgage.py,sha256=I4LD7BD8sxCYoDsgG5BynN3rRiyDAZqGcZySz94qYD0,2355
50
52
  bencher/example/mortgage/example_mortgage_simulator.py,sha256=OXFYYBYqgXdO_IHsf_cELqWqi_CCGfKnaZ9gUrF5cgA,8663
@@ -58,16 +60,16 @@ bencher/plotting/plot_filter.py,sha256=Zff02hEcRffiqDEoXUHVZQJK5kW4HbMxe2GYCrxI8
58
60
  bencher/plotting/plt_cnt_cfg.py,sha256=BkiAsgHm35Mqb5OsjULGVK0Q6pGZ0WSsJxxwSOrbaQs,3124
59
61
  bencher/results/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
62
  bencher/results/bench_result.py,sha256=O0RxxUoudT43zukIKEmwaj8Q156UrEfwyj8NGFFwI0c,2797
61
- bencher/results/bench_result_base.py,sha256=fnNfD6AWw0Hcay0AKWATkc_3hmpdchptDO-khzgz0lU,13197
63
+ bencher/results/bench_result_base.py,sha256=2Ds1KKCv17vMJ7cJwwmmWPPsUde2augP466jxtUuvZs,13378
62
64
  bencher/results/holoview_result.py,sha256=h-Q48m2dkHLPmvHnxmREpzt7MzQ-6iYLWrURDdLPjOw,21310
63
65
  bencher/results/optuna_result.py,sha256=704l1eFJUQGTmnTaj2pIJ9ocRehLgu4PwMYmJU2rY9w,12399
64
66
  bencher/results/panel_result.py,sha256=Fkp7eWt7lzmnM5R6MdEsBeyGg7CEJmlSEHWzNujcIUc,3479
65
67
  bencher/results/plotly_result.py,sha256=vny-HPyWIWzsLWQaOvMswtgVDub9bgQzqcartlFCqjI,2368
66
68
  bencher/variables/inputs.py,sha256=5yN45tet1cPyok6R_XD8xn1FZB5OUUp_TWWF2wIVVdg,6247
67
- bencher/variables/parametrised_sweep.py,sha256=Rx-1GJzpnagmFeQtngdBv44QKvH_pYIqLXqPFB9ufgE,7362
69
+ bencher/variables/parametrised_sweep.py,sha256=q633o5zFY7P0ZeHX4G3AW3jYBfwoqLZZoUeibcln1u0,7483
68
70
  bencher/variables/results.py,sha256=yXdLjfGPSerWhipw_GDZJpBB8KQgCqcdreb8WjIeah8,5119
69
71
  bencher/variables/sweep_base.py,sha256=I1LEeG1y5Jsw0a-Ik03t0tSzcfENht2GmBECJ3KNs28,6559
70
72
  bencher/variables/time.py,sha256=Le7s8_oUYJD4wCqwQw-a_FRDpYQOi8CqMbGYsBF07jg,2860
71
- holobench-1.2.1.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
72
- holobench-1.2.1.dist-info/METADATA,sha256=H6QA0Qqyt7iF5YNP-jc65zw-8fnxTRbVdTcbLOgeqwc,4991
73
- holobench-1.2.1.dist-info/RECORD,,
73
+ holobench-1.2.2.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
74
+ holobench-1.2.2.dist-info/METADATA,sha256=WHKNMDGXx8amGQvMSfJ17lxr4jMPjXaxZjG55M348cU,4991
75
+ holobench-1.2.2.dist-info/RECORD,,