holobench 1.32.0__tar.gz → 1.33.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.
Files changed (101) hide show
  1. {holobench-1.32.0 → holobench-1.33.0}/PKG-INFO +1 -1
  2. {holobench-1.32.0 → holobench-1.33.0}/bencher/__init__.py +1 -1
  3. {holobench-1.32.0 → holobench-1.33.0}/bencher/bench_report.py +42 -7
  4. {holobench-1.32.0 → holobench-1.33.0}/bencher/bench_runner.py +12 -3
  5. holobench-1.33.0/bencher/example/example_publish.py +31 -0
  6. {holobench-1.32.0 → holobench-1.33.0}/pyproject.toml +38 -38
  7. {holobench-1.32.0 → holobench-1.33.0}/.gitignore +0 -0
  8. {holobench-1.32.0 → holobench-1.33.0}/LICENSE +0 -0
  9. {holobench-1.32.0 → holobench-1.33.0}/README.md +0 -0
  10. {holobench-1.32.0 → holobench-1.33.0}/bencher/bench_cfg.py +0 -0
  11. {holobench-1.32.0 → holobench-1.33.0}/bencher/bench_plot_server.py +0 -0
  12. {holobench-1.32.0 → holobench-1.33.0}/bencher/bencher.py +0 -0
  13. {holobench-1.32.0 → holobench-1.33.0}/bencher/caching.py +0 -0
  14. {holobench-1.32.0 → holobench-1.33.0}/bencher/class_enum.py +0 -0
  15. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/__init__.py +0 -0
  16. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/benchmark_data.py +0 -0
  17. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_all.py +0 -0
  18. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_categorical.py +0 -0
  19. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_composable_container.py +0 -0
  20. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_composable_container2.py +0 -0
  21. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_consts.py +0 -0
  22. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_custom_sweep.py +0 -0
  23. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_custom_sweep2.py +0 -0
  24. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_dataframe.py +0 -0
  25. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_docs.py +0 -0
  26. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_filepath.py +0 -0
  27. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_float3D.py +0 -0
  28. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_float_cat.py +0 -0
  29. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_floats.py +0 -0
  30. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_floats2D.py +0 -0
  31. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_holosweep.py +0 -0
  32. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_holosweep_objects.py +0 -0
  33. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_holosweep_tap.py +0 -0
  34. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_image.py +0 -0
  35. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_image1.py +0 -0
  36. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_levels.py +0 -0
  37. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_levels2.py +0 -0
  38. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_pareto.py +0 -0
  39. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_rerun.py +0 -0
  40. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_rerun2.py +0 -0
  41. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_sample_cache.py +0 -0
  42. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_sample_cache_context.py +0 -0
  43. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_simple.py +0 -0
  44. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_simple_bool.py +0 -0
  45. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_simple_cat.py +0 -0
  46. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_simple_float.py +0 -0
  47. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_simple_float2d.py +0 -0
  48. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_strings.py +0 -0
  49. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_time_event.py +0 -0
  50. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_video.py +0 -0
  51. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/example_workflow.py +0 -0
  52. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/experimental/example_bokeh_plotly.py +0 -0
  53. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/experimental/example_hover_ex.py +0 -0
  54. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/experimental/example_hvplot_explorer.py +0 -0
  55. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/experimental/example_interactive.py +0 -0
  56. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/experimental/example_streamnd.py +0 -0
  57. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/experimental/example_streams.py +0 -0
  58. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/experimental/example_template.py +0 -0
  59. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/experimental/example_updates.py +0 -0
  60. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/experimental/example_vector.py +0 -0
  61. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/meta/example_meta.py +0 -0
  62. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/meta/example_meta_cat.py +0 -0
  63. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/meta/example_meta_float.py +0 -0
  64. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/meta/example_meta_levels.py +0 -0
  65. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/optuna/example_optuna.py +0 -0
  66. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/shelved/example_float2D_scatter.py +0 -0
  67. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/shelved/example_float3D_cone.py +0 -0
  68. {holobench-1.32.0 → holobench-1.33.0}/bencher/example/shelved/example_kwargs.py +0 -0
  69. {holobench-1.32.0 → holobench-1.33.0}/bencher/flask_server.py +0 -0
  70. {holobench-1.32.0 → holobench-1.33.0}/bencher/job.py +0 -0
  71. {holobench-1.32.0 → holobench-1.33.0}/bencher/optuna_conversions.py +0 -0
  72. {holobench-1.32.0 → holobench-1.33.0}/bencher/plotting/__init__.py +0 -0
  73. {holobench-1.32.0 → holobench-1.33.0}/bencher/plotting/plot_filter.py +0 -0
  74. {holobench-1.32.0 → holobench-1.33.0}/bencher/plotting/plt_cnt_cfg.py +0 -0
  75. {holobench-1.32.0 → holobench-1.33.0}/bencher/results/__init__.py +0 -0
  76. {holobench-1.32.0 → holobench-1.33.0}/bencher/results/bench_result.py +0 -0
  77. {holobench-1.32.0 → holobench-1.33.0}/bencher/results/bench_result_base.py +0 -0
  78. {holobench-1.32.0 → holobench-1.33.0}/bencher/results/composable_container/__init__.py +0 -0
  79. {holobench-1.32.0 → holobench-1.33.0}/bencher/results/composable_container/composable_container_base.py +0 -0
  80. {holobench-1.32.0 → holobench-1.33.0}/bencher/results/composable_container/composable_container_dataframe.py +0 -0
  81. {holobench-1.32.0 → holobench-1.33.0}/bencher/results/composable_container/composable_container_panel.py +0 -0
  82. {holobench-1.32.0 → holobench-1.33.0}/bencher/results/composable_container/composable_container_video.py +0 -0
  83. {holobench-1.32.0 → holobench-1.33.0}/bencher/results/dataset_result.py +0 -0
  84. {holobench-1.32.0 → holobench-1.33.0}/bencher/results/float_formatter.py +0 -0
  85. {holobench-1.32.0 → holobench-1.33.0}/bencher/results/holoview_result.py +0 -0
  86. {holobench-1.32.0 → holobench-1.33.0}/bencher/results/optuna_result.py +0 -0
  87. {holobench-1.32.0 → holobench-1.33.0}/bencher/results/panel_result.py +0 -0
  88. {holobench-1.32.0 → holobench-1.33.0}/bencher/results/plotly_result.py +0 -0
  89. {holobench-1.32.0 → holobench-1.33.0}/bencher/results/video_result.py +0 -0
  90. {holobench-1.32.0 → holobench-1.33.0}/bencher/results/video_summary.py +0 -0
  91. {holobench-1.32.0 → holobench-1.33.0}/bencher/utils.py +0 -0
  92. {holobench-1.32.0 → holobench-1.33.0}/bencher/utils_rerun.py +0 -0
  93. {holobench-1.32.0 → holobench-1.33.0}/bencher/variables/__init__.py +0 -0
  94. {holobench-1.32.0 → holobench-1.33.0}/bencher/variables/inputs.py +0 -0
  95. {holobench-1.32.0 → holobench-1.33.0}/bencher/variables/parametrised_sweep.py +0 -0
  96. {holobench-1.32.0 → holobench-1.33.0}/bencher/variables/results.py +0 -0
  97. {holobench-1.32.0 → holobench-1.33.0}/bencher/variables/sweep_base.py +0 -0
  98. {holobench-1.32.0 → holobench-1.33.0}/bencher/variables/time.py +0 -0
  99. {holobench-1.32.0 → holobench-1.33.0}/bencher/video_writer.py +0 -0
  100. {holobench-1.32.0 → holobench-1.33.0}/bencher/worker_job.py +0 -0
  101. {holobench-1.32.0 → holobench-1.33.0}/resource/bencher +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: holobench
3
- Version: 1.32.0
3
+ Version: 1.33.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
@@ -64,7 +64,7 @@ from .caching import CachedParams
64
64
  from .results.bench_result import BenchResult
65
65
  from .results.panel_result import PanelResult
66
66
  from .results.holoview_result import ReduceType, HoloviewResult
67
- from .bench_report import BenchReport
67
+ from .bench_report import BenchReport, GithubPagesCfg
68
68
  from .job import Executors
69
69
  from .video_writer import VideoWriter, add_image
70
70
  from .class_enum import ClassEnum, ExampleEnum
@@ -4,6 +4,7 @@ import os
4
4
  from pathlib import Path
5
5
  import tempfile
6
6
  from threading import Thread
7
+ from dataclasses import dataclass
7
8
 
8
9
  import panel as pn
9
10
  from bencher.results.bench_result import BenchResult
@@ -11,6 +12,14 @@ from bencher.bench_plot_server import BenchPlotServer
11
12
  from bencher.bench_cfg import BenchRunCfg
12
13
 
13
14
 
15
+ @dataclass
16
+ class GithubPagesCfg:
17
+ github_user: str
18
+ repo_name: str
19
+ folder_name: str = "report"
20
+ branch_name: str = "gh-pages"
21
+
22
+
14
23
  class BenchReport(BenchPlotServer):
15
24
  def __init__(
16
25
  self,
@@ -111,6 +120,39 @@ class BenchReport(BenchPlotServer):
111
120
 
112
121
  return BenchPlotServer().plot_server(self.bench_name, run_cfg, self.pane)
113
122
 
123
+ def publish_gh_pages(
124
+ self,
125
+ github_user: str,
126
+ repo_name: str,
127
+ folder_name: str = "report",
128
+ branch_name: str = "gh-pages",
129
+ ) -> str: # pragma: no cover
130
+ remote = f"https://github.com/{github_user}/{repo_name}.git"
131
+ publish_url = f"https://{github_user}.github.io/{repo_name}/{folder_name}"
132
+
133
+ with tempfile.TemporaryDirectory() as td:
134
+ directory = td
135
+ report_path = self.save(
136
+ directory + f"/{folder_name}/",
137
+ filename="index.html",
138
+ in_html_folder=False,
139
+ )
140
+ logging.info(f"created report at: {report_path.absolute()}")
141
+
142
+ cd_dir = f"cd {directory} &&"
143
+ # TODO DON'T OVERWRITE EVERYTHING
144
+ os.system(f"{cd_dir} git init")
145
+ os.system(f"{cd_dir} git checkout -b {branch_name}")
146
+ os.system(f"{cd_dir} git add {folder_name}/index.html")
147
+ os.system(f'{cd_dir} git commit -m "publish {branch_name}"')
148
+ os.system(f"{cd_dir} git remote add origin {remote}")
149
+ os.system(f"{cd_dir} git push --set-upstream origin {branch_name} -f")
150
+
151
+ logging.info("Published report @")
152
+ logging.info(publish_url)
153
+
154
+ return publish_url
155
+
114
156
  def publish(
115
157
  self, remote_callback: Callable, branch_name: str = None, debug: bool = False
116
158
  ) -> str: # pragma: no cover
@@ -155,10 +197,3 @@ class BenchReport(BenchPlotServer):
155
197
  logging.info(publish_url)
156
198
 
157
199
  return publish_url
158
-
159
- # @staticmethod
160
- # def publish_github(github_user: str, repo_name: str, branch_name: str) -> Tuple[str, str]:
161
- # return (
162
- # f"https://github.com/{github_user}/{repo_name}.git",
163
- # f"https://github.com/{github_user}/{repo_name}/blob/{branch_name}",
164
- # )
@@ -3,7 +3,7 @@ import logging
3
3
  from bencher.bench_cfg import BenchRunCfg, BenchCfg
4
4
  from bencher.variables.parametrised_sweep import ParametrizedSweep
5
5
  from bencher.bencher import Bench
6
- from bencher.bench_report import BenchReport
6
+ from bencher.bench_report import BenchReport, GithubPagesCfg
7
7
  from copy import deepcopy
8
8
 
9
9
 
@@ -47,7 +47,12 @@ class BenchRunner:
47
47
  run_cfg: BenchRunCfg = BenchRunCfg(),
48
48
  report: BenchReport = BenchReport(),
49
49
  ):
50
- return Bench(f"bench_{class_instance.name}", class_instance, run_cfg=run_cfg, report=report)
50
+ return Bench(
51
+ f"bench_{class_instance.name}",
52
+ class_instance,
53
+ run_cfg=run_cfg,
54
+ report=report,
55
+ )
51
56
 
52
57
  def add_run(self, bench_fn: Benchable) -> None:
53
58
  self.bench_fns.append(bench_fn)
@@ -125,7 +130,11 @@ class BenchRunner:
125
130
  if save:
126
131
  report.save_index()
127
132
  if publish and self.publisher is not None:
128
- report.publish(remote_callback=self.publisher, debug=debug)
133
+ if isinstance(self.publisher, GithubPagesCfg):
134
+ p = self.publisher
135
+ report.publish_gh_pages(p.github_user, p.repo_name, p.folder_name, p.branch_name)
136
+ else:
137
+ report.publish(remote_callback=self.publisher, debug=debug)
129
138
  if show:
130
139
  self.servers.append(report.show())
131
140
 
@@ -0,0 +1,31 @@
1
+ """This file has an example of how to publish a report to github pages"""
2
+
3
+ import math
4
+ import bencher as bch
5
+
6
+
7
+ class SimpleFloat(bch.ParametrizedSweep):
8
+ theta = bch.FloatSweep(
9
+ default=0, bounds=[0, math.pi], doc="Input angle", units="rad", samples=30
10
+ )
11
+ out_sin = bch.ResultVar(units="v", doc="sin of theta")
12
+
13
+ def __call__(self, **kwargs):
14
+ self.update_params_from_kwargs(**kwargs)
15
+ self.out_sin = math.sin(self.theta)
16
+ return super().__call__(**kwargs)
17
+
18
+
19
+ if __name__ == "__main__":
20
+ # publish from report
21
+ bench = SimpleFloat().to_bench()
22
+ bench.plot_sweep()
23
+ bench.report.publish_gh_pages(github_user="blooop", repo_name="reports", folder_name="r5")
24
+ # TODO DON'T OVERWRITE ^ EXAMPLE WHEN RUNNING CODE BELOW
25
+
26
+ # publish from benchrunner
27
+ bench_r = bch.BenchRunner(
28
+ "SimpleFloat", publisher=bch.GithubPagesCfg("blooop", "reports", "r6")
29
+ )
30
+ bench_r.add_bench(SimpleFloat())
31
+ bench_r.run(level=3, show=True, publish=True)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "holobench"
3
- version = "1.32.0"
3
+ version = "1.33.0"
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"
@@ -10,23 +10,23 @@ license = "MIT"
10
10
  requires-python = ">=3.10,<3.13"
11
11
 
12
12
  dependencies = [
13
- "holoviews>=1.15,<=1.19.1",
14
- "numpy>=1.0,<=2.1.3",
15
- "param>=1.13.0,<=2.1.1",
16
- "hvplot>=0.8,<=0.10.0",
17
- "matplotlib>=3.6.3,<=3.9.2",
18
- "panel>=1.3.6,<=1.4.5",
19
- "diskcache>=5.6,<=5.6.3",
20
- "optuna>=3.2,<=4.0.0",
21
- "xarray>=2023.7,<=2024.7.0",
22
- "plotly>=5.15,<=5.24.1",
23
- "sortedcontainers>=2.4,<=2.4",
24
- "pandas>=2.0,<=2.2.2",
25
- "strenum>=0.4.0,<=0.4.15",
26
- "scikit-learn>=1.2,<=1.5.1",
27
- "str2bool>=1.1,<=1.1",
28
- "scoop>=0.7.0,<=0.7.2.0",
29
- "moviepy-fix-codec",
13
+ "holoviews>=1.15,<=1.19.1",
14
+ "numpy>=1.0,<=2.1.3",
15
+ "param>=1.13.0,<=2.1.1",
16
+ "hvplot>=0.8,<=0.10.0",
17
+ "matplotlib>=3.6.3,<=3.9.2",
18
+ "panel>=1.3.6,<=1.4.5",
19
+ "diskcache>=5.6,<=5.6.3",
20
+ "optuna>=3.2,<=4.0.0",
21
+ "xarray>=2023.7,<=2024.7.0",
22
+ "plotly>=5.15,<=5.24.1",
23
+ "sortedcontainers>=2.4,<=2.4",
24
+ "pandas>=2.0,<=2.2.2",
25
+ "strenum>=0.4.0,<=0.4.15",
26
+ "scikit-learn>=1.2,<=1.5.1",
27
+ "str2bool>=1.1,<=1.1",
28
+ "scoop>=0.7.0,<=0.7.2.0",
29
+ "moviepy-fix-codec",
30
30
  ]
31
31
 
32
32
  [project.urls]
@@ -54,13 +54,13 @@ holobench = { path = ".", editable = true }
54
54
 
55
55
  [project.optional-dependencies]
56
56
  test = [
57
- "pylint>=3.2.5,<=3.3.1",
58
- "pytest-cov>=4.1,<=6.0.0",
59
- "pytest>=7.4,<=8.3.3",
60
- "hypothesis>=6.104.2,<=6.122.0",
61
- "ruff>=0.5.0,<=0.8.1",
62
- "coverage>=7.5.4,<=7.6.8",
63
- "pre-commit<=4.0.1",
57
+ "pylint>=3.2.5,<=3.3.1",
58
+ "pytest-cov>=4.1,<=6.0.0",
59
+ "pytest>=7.4,<=8.3.3",
60
+ "hypothesis>=6.104.2,<=6.122.0",
61
+ "ruff>=0.5.0,<=0.8.1",
62
+ "coverage>=7.5.4,<=7.6.8",
63
+ "pre-commit<=4.0.1",
64
64
  ]
65
65
 
66
66
  #adds support for embedding rerun windows (alpha)
@@ -101,11 +101,11 @@ fix = { depends_on = ["update-lock", "pre-commit", "format", "ruff-lint"] }
101
101
  fix-commit-push = { depends_on = ["fix", "commit-format", "update-lock-push"] }
102
102
  ci-no-cover = { depends_on = ["style", "test"] }
103
103
  ci = { depends_on = [
104
- "format",
105
- "ruff-lint",
106
- "pylint",
107
- "coverage",
108
- "coverage-report",
104
+ "format",
105
+ "ruff-lint",
106
+ "pylint",
107
+ "coverage",
108
+ "coverage-report",
109
109
  ] }
110
110
  ci-push = { depends_on = ["format", "ruff-lint", "update-lock", "ci", "push"] }
111
111
  clear-pixi = "rm -rf .pixi pixi.lock"
@@ -129,12 +129,12 @@ omit = ["*/test/*", "__init__.py"]
129
129
 
130
130
  [tool.coverage.report]
131
131
  exclude_also = [
132
- "def __repr__",
133
- "if False:",
134
- "if 0:",
135
- "raise AssertionError",
136
- "raise NotImplementedError",
137
- "if __name__ == .__main__.:",
138
- "pass",
139
- "(_):",
132
+ "def __repr__",
133
+ "if False:",
134
+ "if 0:",
135
+ "raise AssertionError",
136
+ "raise NotImplementedError",
137
+ "if __name__ == .__main__.:",
138
+ "pass",
139
+ "(_):",
140
140
  ]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes