holobench 1.32.0__py3-none-any.whl → 1.33.1__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.
- bencher/__init__.py +1 -1
- bencher/bench_report.py +42 -7
- bencher/bench_runner.py +12 -3
- bencher/example/example_publish.py +31 -0
- {holobench-1.32.0.dist-info → holobench-1.33.1.dist-info}/METADATA +18 -17
- {holobench-1.32.0.dist-info → holobench-1.33.1.dist-info}/RECORD +8 -7
- {holobench-1.32.0.dist-info → holobench-1.33.1.dist-info}/WHEEL +1 -1
- {holobench-1.32.0.dist-info → holobench-1.33.1.dist-info}/licenses/LICENSE +0 -0
bencher/__init__.py
CHANGED
@@ -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
|
bencher/bench_report.py
CHANGED
@@ -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
|
-
# )
|
bencher/bench_runner.py
CHANGED
@@ -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(
|
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
|
-
|
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,43 +1,44 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: holobench
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.33.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
|
7
7
|
Project-URL: Documentation, https://bencher.readthedocs.io/en/latest/
|
8
8
|
Author-email: Austin Gregg-Smith <blooop@gmail.com>
|
9
|
-
License: MIT
|
9
|
+
License-Expression: MIT
|
10
|
+
License-File: LICENSE
|
10
11
|
Requires-Python: <3.13,>=3.10
|
11
12
|
Requires-Dist: diskcache<=5.6.3,>=5.6
|
12
|
-
Requires-Dist: holoviews<=1.
|
13
|
+
Requires-Dist: holoviews<=1.20.0,>=1.15
|
13
14
|
Requires-Dist: hvplot<=0.10.0,>=0.8
|
14
|
-
Requires-Dist: matplotlib<=3.
|
15
|
+
Requires-Dist: matplotlib<=3.10.0,>=3.6.3
|
15
16
|
Requires-Dist: moviepy-fix-codec
|
16
|
-
Requires-Dist: numpy<=2.1
|
17
|
-
Requires-Dist: optuna<=4.
|
18
|
-
Requires-Dist: pandas<=2.2.
|
19
|
-
Requires-Dist: panel<=1.
|
20
|
-
Requires-Dist: param<=2.
|
17
|
+
Requires-Dist: numpy<=2.2.1,>=1.0
|
18
|
+
Requires-Dist: optuna<=4.1.0,>=3.2
|
19
|
+
Requires-Dist: pandas<=2.2.3,>=2.0
|
20
|
+
Requires-Dist: panel<=1.5.5,>=1.3.6
|
21
|
+
Requires-Dist: param<=2.2.0,>=1.13.0
|
21
22
|
Requires-Dist: plotly<=5.24.1,>=5.15
|
22
|
-
Requires-Dist: scikit-learn<=1.
|
23
|
+
Requires-Dist: scikit-learn<=1.6.0,>=1.2
|
23
24
|
Requires-Dist: scoop<=0.7.2.0,>=0.7.0
|
24
25
|
Requires-Dist: sortedcontainers<=2.4,>=2.4
|
25
26
|
Requires-Dist: str2bool<=1.1,>=1.1
|
26
27
|
Requires-Dist: strenum<=0.4.15,>=0.4.0
|
27
|
-
Requires-Dist: xarray<=2024.
|
28
|
+
Requires-Dist: xarray<=2024.11.0,>=2023.7
|
28
29
|
Provides-Extra: rerun
|
29
30
|
Requires-Dist: flask; extra == 'rerun'
|
30
31
|
Requires-Dist: flask-cors; extra == 'rerun'
|
31
32
|
Requires-Dist: rerun-notebook; extra == 'rerun'
|
32
33
|
Requires-Dist: rerun-sdk==0.20.1; extra == 'rerun'
|
33
34
|
Provides-Extra: test
|
34
|
-
Requires-Dist: coverage<=7.6.
|
35
|
-
Requires-Dist: hypothesis<=6.
|
35
|
+
Requires-Dist: coverage<=7.6.10,>=7.5.4; extra == 'test'
|
36
|
+
Requires-Dist: hypothesis<=6.123.2,>=6.104.2; extra == 'test'
|
36
37
|
Requires-Dist: pre-commit<=4.0.1; extra == 'test'
|
37
|
-
Requires-Dist: pylint<=3.3.
|
38
|
+
Requires-Dist: pylint<=3.3.3,>=3.2.5; extra == 'test'
|
38
39
|
Requires-Dist: pytest-cov<=6.0.0,>=4.1; extra == 'test'
|
39
|
-
Requires-Dist: pytest<=8.3.
|
40
|
-
Requires-Dist: ruff<=0.8.
|
40
|
+
Requires-Dist: pytest<=8.3.4,>=7.4; extra == 'test'
|
41
|
+
Requires-Dist: ruff<=0.8.4,>=0.5.0; extra == 'test'
|
41
42
|
Description-Content-Type: text/markdown
|
42
43
|
|
43
44
|
# Bencher
|
@@ -1,8 +1,8 @@
|
|
1
|
-
bencher/__init__.py,sha256=
|
1
|
+
bencher/__init__.py,sha256=CDfQPU9g0x4aYkYblf5epfJSg20Xv2giWFckhTF2de0,1834
|
2
2
|
bencher/bench_cfg.py,sha256=mcsF5VU7Z-BLKE0bh9te73cEVNzr9pCnbsdIOPCJPy4,18414
|
3
3
|
bencher/bench_plot_server.py,sha256=nvGTr981XgWELqV7yID91j6V1UIPGtKilzxHcNWaZ6Q,4196
|
4
|
-
bencher/bench_report.py,sha256=
|
5
|
-
bencher/bench_runner.py,sha256=
|
4
|
+
bencher/bench_report.py,sha256=ikMSHceyc8cYFH-sIza167DH-H-_iiTYDm2TmusUHDc,7515
|
5
|
+
bencher/bench_runner.py,sha256=YkE7LXd-5dZ3Dro2OfuChXyTKVqQw1VqQmP5sdnZdLE,6490
|
6
6
|
bencher/bencher.py,sha256=C71paITRtrESt_O2RNFdJ17Hg2zB6FSX4RINRsJq59c,35328
|
7
7
|
bencher/caching.py,sha256=AusaNrzGGlj5m6zcwcqnTn55Mam2mQdF--oqelO806M,1627
|
8
8
|
bencher/class_enum.py,sha256=kYHW9qKkKcNdwaXizZL-fTptS_DUEGv4c88yCehk3gc,1492
|
@@ -37,6 +37,7 @@ bencher/example/example_image1.py,sha256=3T6rgmCL7mCra2F6us-Fy0_jwhh7OvStmSieQui
|
|
37
37
|
bencher/example/example_levels.py,sha256=gcNqjdsC0Bi0dX9oakssPEmuh_zFqpJhPYPPoDN3uw8,6890
|
38
38
|
bencher/example/example_levels2.py,sha256=tMhA6dYYQskzMeAZdaz6jRmQTe-c-jLXfkaUqWT30-I,1117
|
39
39
|
bencher/example/example_pareto.py,sha256=sLh37iZSQitW7DE7ktbyaOgHr1ZWxG7pXxCMH00KKqQ,2688
|
40
|
+
bencher/example/example_publish.py,sha256=qIilHdsjqcUQ5u_IuGjjhJCLRkcQvhVuhI3efDrFTww,1005
|
40
41
|
bencher/example/example_rerun.py,sha256=gruldZ6tmW56Mc6bPrNc7ChZEGHhYXPE4VVeG-L8w7M,981
|
41
42
|
bencher/example/example_rerun2.py,sha256=TV8e2UMwLFowhiXb_sQG2IS-W5jXF67VCitVjD8u1o8,660
|
42
43
|
bencher/example/example_sample_cache.py,sha256=7gf1BJ63VAgdqNuNXkbL9-jeTeC3kXA_PY9yG3ulTz0,4200
|
@@ -93,7 +94,7 @@ bencher/variables/results.py,sha256=Wq14e8rAj5mcK22325wcaeTMjgZ6JuduqceAHItHFY8,
|
|
93
94
|
bencher/variables/sweep_base.py,sha256=gfEhKvsb16ZLbe38JewZqu0AMOHpsqwRbZbt-aCg9Bc,6258
|
94
95
|
bencher/variables/time.py,sha256=zcRS5p4ZkFjMta9nZMEuWv86rLnPkUSqyO69QwI5q3E,3142
|
95
96
|
resource/bencher,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
96
|
-
holobench-1.
|
97
|
-
holobench-1.
|
98
|
-
holobench-1.
|
99
|
-
holobench-1.
|
97
|
+
holobench-1.33.1.dist-info/METADATA,sha256=T-8JdF_e_nEXUizB4QuZ3oxYUrPCMXzdWgcln7Au0LI,6600
|
98
|
+
holobench-1.33.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
99
|
+
holobench-1.33.1.dist-info/licenses/LICENSE,sha256=dSHXTdRY4Y7qGFMv63UksV700iff7iE-p7GGs6Sbnvo,1065
|
100
|
+
holobench-1.33.1.dist-info/RECORD,,
|
File without changes
|