holobench 1.30.2__tar.gz → 1.30.3__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 (96) hide show
  1. {holobench-1.30.2 → holobench-1.30.3}/PKG-INFO +3 -3
  2. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_float3D.py +24 -44
  3. {holobench-1.30.2 → holobench-1.30.3}/pyproject.toml +4 -4
  4. {holobench-1.30.2 → holobench-1.30.3}/.gitignore +0 -0
  5. {holobench-1.30.2 → holobench-1.30.3}/LICENSE +0 -0
  6. {holobench-1.30.2 → holobench-1.30.3}/README.md +0 -0
  7. {holobench-1.30.2 → holobench-1.30.3}/bencher/__init__.py +0 -0
  8. {holobench-1.30.2 → holobench-1.30.3}/bencher/bench_cfg.py +0 -0
  9. {holobench-1.30.2 → holobench-1.30.3}/bencher/bench_plot_server.py +0 -0
  10. {holobench-1.30.2 → holobench-1.30.3}/bencher/bench_report.py +0 -0
  11. {holobench-1.30.2 → holobench-1.30.3}/bencher/bench_runner.py +0 -0
  12. {holobench-1.30.2 → holobench-1.30.3}/bencher/bencher.py +0 -0
  13. {holobench-1.30.2 → holobench-1.30.3}/bencher/caching.py +0 -0
  14. {holobench-1.30.2 → holobench-1.30.3}/bencher/class_enum.py +0 -0
  15. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/__init__.py +0 -0
  16. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/benchmark_data.py +0 -0
  17. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_all.py +0 -0
  18. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_categorical.py +0 -0
  19. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_composable_container.py +0 -0
  20. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_composable_container2.py +0 -0
  21. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_consts.py +0 -0
  22. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_custom_sweep.py +0 -0
  23. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_custom_sweep2.py +0 -0
  24. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_dataframe.py +0 -0
  25. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_docs.py +0 -0
  26. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_filepath.py +0 -0
  27. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_float_cat.py +0 -0
  28. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_floats.py +0 -0
  29. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_floats2D.py +0 -0
  30. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_holosweep.py +0 -0
  31. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_holosweep_objects.py +0 -0
  32. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_holosweep_tap.py +0 -0
  33. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_image.py +0 -0
  34. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_image1.py +0 -0
  35. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_levels.py +0 -0
  36. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_levels2.py +0 -0
  37. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_pareto.py +0 -0
  38. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_sample_cache.py +0 -0
  39. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_sample_cache_context.py +0 -0
  40. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_simple.py +0 -0
  41. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_simple_bool.py +0 -0
  42. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_simple_cat.py +0 -0
  43. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_simple_float.py +0 -0
  44. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_simple_float2d.py +0 -0
  45. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_strings.py +0 -0
  46. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_time_event.py +0 -0
  47. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_video.py +0 -0
  48. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/example_workflow.py +0 -0
  49. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/experimental/example_bokeh_plotly.py +0 -0
  50. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/experimental/example_hover_ex.py +0 -0
  51. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/experimental/example_hvplot_explorer.py +0 -0
  52. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/experimental/example_interactive.py +0 -0
  53. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/experimental/example_streamnd.py +0 -0
  54. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/experimental/example_streams.py +0 -0
  55. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/experimental/example_template.py +0 -0
  56. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/experimental/example_updates.py +0 -0
  57. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/experimental/example_vector.py +0 -0
  58. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/meta/example_meta.py +0 -0
  59. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/meta/example_meta_cat.py +0 -0
  60. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/meta/example_meta_float.py +0 -0
  61. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/meta/example_meta_levels.py +0 -0
  62. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/optuna/example_optuna.py +0 -0
  63. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/shelved/example_float2D_scatter.py +0 -0
  64. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/shelved/example_float3D_cone.py +0 -0
  65. {holobench-1.30.2 → holobench-1.30.3}/bencher/example/shelved/example_kwargs.py +0 -0
  66. {holobench-1.30.2 → holobench-1.30.3}/bencher/job.py +0 -0
  67. {holobench-1.30.2 → holobench-1.30.3}/bencher/optuna_conversions.py +0 -0
  68. {holobench-1.30.2 → holobench-1.30.3}/bencher/plotting/__init__.py +0 -0
  69. {holobench-1.30.2 → holobench-1.30.3}/bencher/plotting/plot_filter.py +0 -0
  70. {holobench-1.30.2 → holobench-1.30.3}/bencher/plotting/plt_cnt_cfg.py +0 -0
  71. {holobench-1.30.2 → holobench-1.30.3}/bencher/results/__init__.py +0 -0
  72. {holobench-1.30.2 → holobench-1.30.3}/bencher/results/bench_result.py +0 -0
  73. {holobench-1.30.2 → holobench-1.30.3}/bencher/results/bench_result_base.py +0 -0
  74. {holobench-1.30.2 → holobench-1.30.3}/bencher/results/composable_container/__init__.py +0 -0
  75. {holobench-1.30.2 → holobench-1.30.3}/bencher/results/composable_container/composable_container_base.py +0 -0
  76. {holobench-1.30.2 → holobench-1.30.3}/bencher/results/composable_container/composable_container_dataframe.py +0 -0
  77. {holobench-1.30.2 → holobench-1.30.3}/bencher/results/composable_container/composable_container_panel.py +0 -0
  78. {holobench-1.30.2 → holobench-1.30.3}/bencher/results/composable_container/composable_container_video.py +0 -0
  79. {holobench-1.30.2 → holobench-1.30.3}/bencher/results/dataset_result.py +0 -0
  80. {holobench-1.30.2 → holobench-1.30.3}/bencher/results/float_formatter.py +0 -0
  81. {holobench-1.30.2 → holobench-1.30.3}/bencher/results/holoview_result.py +0 -0
  82. {holobench-1.30.2 → holobench-1.30.3}/bencher/results/optuna_result.py +0 -0
  83. {holobench-1.30.2 → holobench-1.30.3}/bencher/results/panel_result.py +0 -0
  84. {holobench-1.30.2 → holobench-1.30.3}/bencher/results/plotly_result.py +0 -0
  85. {holobench-1.30.2 → holobench-1.30.3}/bencher/results/video_result.py +0 -0
  86. {holobench-1.30.2 → holobench-1.30.3}/bencher/results/video_summary.py +0 -0
  87. {holobench-1.30.2 → holobench-1.30.3}/bencher/utils.py +0 -0
  88. {holobench-1.30.2 → holobench-1.30.3}/bencher/variables/__init__.py +0 -0
  89. {holobench-1.30.2 → holobench-1.30.3}/bencher/variables/inputs.py +0 -0
  90. {holobench-1.30.2 → holobench-1.30.3}/bencher/variables/parametrised_sweep.py +0 -0
  91. {holobench-1.30.2 → holobench-1.30.3}/bencher/variables/results.py +0 -0
  92. {holobench-1.30.2 → holobench-1.30.3}/bencher/variables/sweep_base.py +0 -0
  93. {holobench-1.30.2 → holobench-1.30.3}/bencher/variables/time.py +0 -0
  94. {holobench-1.30.2 → holobench-1.30.3}/bencher/video_writer.py +0 -0
  95. {holobench-1.30.2 → holobench-1.30.3}/bencher/worker_job.py +0 -0
  96. {holobench-1.30.2 → holobench-1.30.3}/resource/bencher +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: holobench
3
- Version: 1.30.2
3
+ Version: 1.30.3
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
@@ -13,12 +13,12 @@ Requires-Dist: holoviews<=1.19.1,>=1.15
13
13
  Requires-Dist: hvplot<=0.10.0,>=0.8
14
14
  Requires-Dist: matplotlib<=3.9.2,>=3.6.3
15
15
  Requires-Dist: moviepy-fix-codec
16
- Requires-Dist: numpy<=2.1.0,>=1.0
16
+ Requires-Dist: numpy<=2.1.3,>=1.0
17
17
  Requires-Dist: optuna<=4.0.0,>=3.2
18
18
  Requires-Dist: pandas<=2.2.2,>=2.0
19
19
  Requires-Dist: panel<=1.4.5,>=1.3.6
20
20
  Requires-Dist: param<=2.1.1,>=1.13.0
21
- Requires-Dist: plotly<=5.24.0,>=5.15
21
+ Requires-Dist: plotly<=5.24.1,>=5.15
22
22
  Requires-Dist: scikit-learn<=1.5.1,>=1.2
23
23
  Requires-Dist: scoop<=0.7.2.0,>=0.7.0
24
24
  Requires-Dist: sortedcontainers<=2.4,>=2.4
@@ -1,11 +1,9 @@
1
1
  # pylint: disable=duplicate-code
2
-
3
2
  import numpy as np
4
-
5
3
  import bencher as bch
6
4
 
7
5
 
8
- class VolumeSample(bch.ParametrizedSweep):
6
+ class VolumeSweep(bch.ParametrizedSweep):
9
7
  """A class to represent a 3D point in space."""
10
8
 
11
9
  x = bch.FloatSweep(
@@ -18,10 +16,6 @@ class VolumeSample(bch.ParametrizedSweep):
18
16
  default=0, bounds=[-1.0, 1.0], doc="z coordinate of the sample volume", samples=6
19
17
  )
20
18
 
21
-
22
- class VolumeResult(bch.ParametrizedSweep):
23
- """A class to represent the properties of a volume sample."""
24
-
25
19
  value = bch.ResultVar("ul", doc="The scalar value of the 3D volume field")
26
20
  occupancy = bch.ResultVar(
27
21
  "occupied", doc="If the value is > 0.5 this point is considered occupied"
@@ -32,33 +26,25 @@ class VolumeResult(bch.ParametrizedSweep):
32
26
  3, "vec", doc="The same vector field but only showing values in a sphere of radius 0.5"
33
27
  )
34
28
 
29
+ def __call__(self, **kwargs) -> dict:
30
+ """This function takes a 3D point as input and returns distance of that point to the origin."""
31
+ self.update_params_from_kwargs(**kwargs)
32
+ self.value = np.linalg.norm(np.array([self.x, self.y, self.z])) # distance to origin
33
+ self.occupancy = float(self.value < 0.5)
34
+ # from https://plotly.com/python/3d-volume-plots/
35
+ self.interesting = np.sin(np.pi * self.x) * np.cos(np.pi * self.z) * np.sin(np.pi * self.y)
36
+ self.interesting_vec = [
37
+ np.sin(np.pi * self.x),
38
+ np.cos(np.pi * self.z),
39
+ np.sin(np.pi * self.y),
40
+ ]
35
41
 
36
- def bench_fn(point: VolumeSample) -> VolumeResult:
37
- """This function takes a 3D point as input and returns distance of that point to the origin.
42
+ if self.occupancy:
43
+ self.interesting_vec_and_occ = self.interesting_vec
44
+ else:
45
+ self.interesting_vec_and_occ = [0, 0, 0]
38
46
 
39
- Args:
40
- point (VolumeSample): Sample point
41
-
42
- Returns:
43
- VolumeResult: Value at that point
44
- """
45
- output = VolumeResult()
46
- output.value = np.linalg.norm(np.array([point.x, point.y, point.z])) # distance to origin
47
- output.occupancy = float(output.value < 0.5)
48
- # from https://plotly.com/python/3d-volume-plots/
49
- output.interesting = np.sin(np.pi * point.x) * np.cos(np.pi * point.z) * np.sin(np.pi * point.y)
50
- output.interesting_vec = [
51
- np.sin(np.pi * point.x),
52
- np.cos(np.pi * point.z),
53
- np.sin(np.pi * point.y),
54
- ]
55
-
56
- if output.occupancy:
57
- output.interesting_vec_and_occ = output.interesting_vec
58
- else:
59
- output.interesting_vec_and_occ = [0, 0, 0]
60
-
61
- return output
47
+ return super().__call__()
62
48
 
63
49
 
64
50
  def example_floats3D(
@@ -72,21 +58,15 @@ def example_floats3D(
72
58
  Returns:
73
59
  Bench: results of the parameter sweep
74
60
  """
75
- bench = bch.Bench(
76
- "Bencher_Example_Floats",
77
- bench_fn,
78
- VolumeSample,
79
- run_cfg=run_cfg,
80
- report=report,
81
- )
61
+ bench = VolumeSweep().to_bench(run_cfg=run_cfg, report=report)
82
62
 
83
63
  bench.plot_sweep(
84
64
  title="Float 3D Example",
85
- input_vars=[VolumeSample.param.x, VolumeSample.param.y, VolumeSample.param.z],
65
+ input_vars=["x", "y", "z"],
86
66
  result_vars=[
87
- VolumeResult.param.value,
88
- VolumeResult.param.occupancy,
89
- VolumeResult.param.interesting,
67
+ "value",
68
+ "occupancy",
69
+ "interesting",
90
70
  ],
91
71
  description="""This example shows how to sample 3 floating point variables and plot a volumetric representation of the results. The benchmark function returns the distance to the origin""",
92
72
  post_description="Here you can see concentric shells as the value of the function increases with distance from the origin. The occupancy graph should show a sphere with radius=0.5",
@@ -97,5 +77,5 @@ def example_floats3D(
97
77
 
98
78
  if __name__ == "__main__":
99
79
  ex_run_cfg = bch.BenchRunCfg()
100
- ex_run_cfg.level = 3
80
+ ex_run_cfg.level = 6
101
81
  example_floats3D(ex_run_cfg).report.show()
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "holobench"
3
- version = "1.30.2"
3
+ version = "1.30.3"
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"
@@ -11,7 +11,7 @@ requires-python = ">=3.10,<3.13"
11
11
 
12
12
  dependencies = [
13
13
  "holoviews>=1.15,<=1.19.1",
14
- "numpy>=1.0,<=2.1.0",
14
+ "numpy>=1.0,<=2.1.3",
15
15
  "param>=1.13.0,<=2.1.1",
16
16
  "hvplot>=0.8,<=0.10.0",
17
17
  "matplotlib>=3.6.3,<=3.9.2",
@@ -19,7 +19,7 @@ dependencies = [
19
19
  "diskcache>=5.6,<=5.6.3",
20
20
  "optuna>=3.2,<=4.0.0",
21
21
  "xarray>=2023.7,<=2024.7.0",
22
- "plotly>=5.15,<=5.24.0",
22
+ "plotly>=5.15,<=5.24.1",
23
23
  "sortedcontainers>=2.4,<=2.4",
24
24
  "pandas>=2.0,<=2.2.2",
25
25
  "strenum>=0.4.0,<=0.4.15",
@@ -92,7 +92,7 @@ coverage-report = "coverage report -m"
92
92
  update-lock = "pixi update && git commit -a -m'update pixi.lock' || true"
93
93
  push = "git push"
94
94
  update-lock-push = { depends_on = ["update-lock", "push"] }
95
- fix = { depends_on = ["update-lock", "format", "ruff-lint"] }
95
+ fix = { depends_on = ["update-lock","pre-commit", "format", "ruff-lint"] }
96
96
  fix-commit-push = { depends_on = ["fix", "commit-format", "update-lock-push"] }
97
97
  ci-no-cover = { depends_on = ["style", "test"] }
98
98
  ci = { depends_on = ["format","ruff-lint", "pylint", "coverage", "coverage-report"] }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes