holobench 1.30.3__tar.gz → 1.31.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.
- {holobench-1.30.3 → holobench-1.31.1}/.gitignore +1 -0
- {holobench-1.30.3 → holobench-1.31.1}/PKG-INFO +5 -1
- {holobench-1.30.3 → holobench-1.31.1}/bencher/__init__.py +21 -3
- {holobench-1.30.3 → holobench-1.31.1}/bencher/bench_report.py +1 -2
- holobench-1.31.1/bencher/example/example_rerun.py +30 -0
- holobench-1.31.1/bencher/example/example_rerun2.py +29 -0
- holobench-1.31.1/bencher/flask_server.py +25 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/utils.py +96 -0
- holobench-1.31.1/bencher/utils_rerun.py +41 -0
- {holobench-1.30.3 → holobench-1.31.1}/pyproject.toml +9 -1
- {holobench-1.30.3 → holobench-1.31.1}/LICENSE +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/README.md +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/bench_cfg.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/bench_plot_server.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/bench_runner.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/bencher.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/caching.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/class_enum.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/__init__.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/benchmark_data.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_all.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_categorical.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_composable_container.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_composable_container2.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_consts.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_custom_sweep.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_custom_sweep2.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_dataframe.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_docs.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_filepath.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_float3D.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_float_cat.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_floats.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_floats2D.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_holosweep.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_holosweep_objects.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_holosweep_tap.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_image.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_image1.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_levels.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_levels2.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_pareto.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_sample_cache.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_sample_cache_context.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_simple.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_simple_bool.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_simple_cat.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_simple_float.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_simple_float2d.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_strings.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_time_event.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_video.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/example_workflow.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/experimental/example_bokeh_plotly.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/experimental/example_hover_ex.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/experimental/example_hvplot_explorer.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/experimental/example_interactive.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/experimental/example_streamnd.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/experimental/example_streams.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/experimental/example_template.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/experimental/example_updates.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/experimental/example_vector.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/meta/example_meta.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/meta/example_meta_cat.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/meta/example_meta_float.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/meta/example_meta_levels.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/optuna/example_optuna.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/shelved/example_float2D_scatter.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/shelved/example_float3D_cone.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/example/shelved/example_kwargs.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/job.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/optuna_conversions.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/plotting/__init__.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/plotting/plot_filter.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/plotting/plt_cnt_cfg.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/results/__init__.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/results/bench_result.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/results/bench_result_base.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/results/composable_container/__init__.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/results/composable_container/composable_container_base.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/results/composable_container/composable_container_dataframe.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/results/composable_container/composable_container_panel.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/results/composable_container/composable_container_video.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/results/dataset_result.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/results/float_formatter.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/results/holoview_result.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/results/optuna_result.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/results/panel_result.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/results/plotly_result.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/results/video_result.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/results/video_summary.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/variables/__init__.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/variables/inputs.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/variables/parametrised_sweep.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/variables/results.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/variables/sweep_base.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/variables/time.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/video_writer.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/bencher/worker_job.py +0 -0
- {holobench-1.30.3 → holobench-1.31.1}/resource/bencher +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: holobench
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.31.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
|
@@ -9,6 +9,8 @@ Author-email: Austin Gregg-Smith <blooop@gmail.com>
|
|
9
9
|
License: MIT
|
10
10
|
Requires-Python: <3.13,>=3.10
|
11
11
|
Requires-Dist: diskcache<=5.6.3,>=5.6
|
12
|
+
Requires-Dist: flask
|
13
|
+
Requires-Dist: flask-cors
|
12
14
|
Requires-Dist: holoviews<=1.19.1,>=1.15
|
13
15
|
Requires-Dist: hvplot<=0.10.0,>=0.8
|
14
16
|
Requires-Dist: matplotlib<=3.9.2,>=3.6.3
|
@@ -19,6 +21,8 @@ Requires-Dist: pandas<=2.2.2,>=2.0
|
|
19
21
|
Requires-Dist: panel<=1.4.5,>=1.3.6
|
20
22
|
Requires-Dist: param<=2.1.1,>=1.13.0
|
21
23
|
Requires-Dist: plotly<=5.24.1,>=5.15
|
24
|
+
Requires-Dist: rerun-notebook
|
25
|
+
Requires-Dist: rerun-sdk==0.20.1
|
22
26
|
Requires-Dist: scikit-learn<=1.5.1,>=1.2
|
23
27
|
Requires-Dist: scoop<=0.7.2.0,>=0.7.0
|
24
28
|
Requires-Dist: sortedcontainers<=2.4,>=2.4
|
@@ -1,9 +1,20 @@
|
|
1
1
|
from .bencher import Bench, BenchCfg, BenchRunCfg
|
2
2
|
from .bench_runner import BenchRunner
|
3
|
-
from .example.benchmark_data import
|
3
|
+
from .example.benchmark_data import (
|
4
|
+
ExampleBenchCfgIn,
|
5
|
+
ExampleBenchCfgOut,
|
6
|
+
bench_function,
|
7
|
+
)
|
4
8
|
from .bench_plot_server import BenchPlotServer
|
5
9
|
from .variables.sweep_base import hash_sha1
|
6
|
-
from .variables.inputs import
|
10
|
+
from .variables.inputs import (
|
11
|
+
IntSweep,
|
12
|
+
FloatSweep,
|
13
|
+
StringSweep,
|
14
|
+
EnumSweep,
|
15
|
+
BoolSweep,
|
16
|
+
SweepBase,
|
17
|
+
)
|
7
18
|
from .variables.time import TimeSnapshot
|
8
19
|
|
9
20
|
from .variables.inputs import box, p
|
@@ -32,7 +43,6 @@ from .results.composable_container.composable_container_video import (
|
|
32
43
|
RenderCfg,
|
33
44
|
)
|
34
45
|
|
35
|
-
from .plotting.plot_filter import VarRange, PlotFilter
|
36
46
|
from .utils import (
|
37
47
|
hmap_canonical_input,
|
38
48
|
get_nearest_coords,
|
@@ -40,9 +50,15 @@ from .utils import (
|
|
40
50
|
gen_path,
|
41
51
|
gen_image_path,
|
42
52
|
gen_video_path,
|
53
|
+
gen_rerun_data_path,
|
43
54
|
lerp,
|
44
55
|
tabs_in_markdown,
|
56
|
+
publish_file,
|
57
|
+
github_content,
|
45
58
|
)
|
59
|
+
from .utils_rerun import publish_and_view_rrd, rrd_to_pane, capture_rerun_window
|
60
|
+
|
61
|
+
from .plotting.plot_filter import VarRange, PlotFilter
|
46
62
|
from .variables.parametrised_sweep import ParametrizedSweep
|
47
63
|
from .caching import CachedParams
|
48
64
|
from .results.bench_result import BenchResult
|
@@ -52,3 +68,5 @@ from .bench_report import BenchReport
|
|
52
68
|
from .job import Executors
|
53
69
|
from .video_writer import VideoWriter, add_image
|
54
70
|
from .class_enum import ClassEnum, ExampleEnum
|
71
|
+
|
72
|
+
from .flask_server import run_flask_in_thread
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import logging
|
2
2
|
from typing import Callable
|
3
3
|
import os
|
4
|
-
import panel as pn
|
5
4
|
from pathlib import Path
|
6
5
|
import tempfile
|
7
|
-
|
8
6
|
from threading import Thread
|
9
7
|
|
8
|
+
import panel as pn
|
10
9
|
from bencher.results.bench_result import BenchResult
|
11
10
|
from bencher.bench_plot_server import BenchPlotServer
|
12
11
|
from bencher.bench_cfg import BenchRunCfg
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import rerun as rr
|
2
|
+
import bencher as bch
|
3
|
+
|
4
|
+
rr.init("rerun_example_my_blueprint")
|
5
|
+
|
6
|
+
|
7
|
+
class SweepRerun(bch.ParametrizedSweep):
|
8
|
+
theta = bch.FloatSweep(default=1, bounds=[1, 4], doc="Input angle", units="rad", samples=30)
|
9
|
+
|
10
|
+
out_pane = bch.ResultContainer()
|
11
|
+
|
12
|
+
def __call__(self, **kwargs):
|
13
|
+
self.update_params_from_kwargs(**kwargs)
|
14
|
+
self.out_pane = bch.capture_rerun_window(width=300, height=300)
|
15
|
+
rr.log("s1", rr.Boxes2D(half_sizes=[self.theta, 1]))
|
16
|
+
|
17
|
+
return super().__call__(**kwargs)
|
18
|
+
|
19
|
+
|
20
|
+
def example_rerun(run_cfg: bch.BenchRunCfg = None, report: bch.BenchReport = None) -> bch.Bench:
|
21
|
+
"""This example shows how to sample a 1 dimensional float variable and plot the result of passing that parameter sweep to the benchmarking function"""
|
22
|
+
|
23
|
+
bench = SweepRerun().to_bench(run_cfg, report)
|
24
|
+
bench.plot_sweep()
|
25
|
+
return bench
|
26
|
+
|
27
|
+
|
28
|
+
if __name__ == "__main__":
|
29
|
+
bch.run_flask_in_thread()
|
30
|
+
example_rerun(bch.BenchRunCfg(level=3)).report.show()
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import rerun as rr
|
2
|
+
import bencher as bch
|
3
|
+
import panel as pn
|
4
|
+
|
5
|
+
|
6
|
+
rr.init("rerun_example_local", spawn=True)
|
7
|
+
file_path = "dat1.rrd"
|
8
|
+
rr.save(file_path)
|
9
|
+
|
10
|
+
rr.log("s1", rr.Scalar(1))
|
11
|
+
rr.log("s1", rr.Scalar(4))
|
12
|
+
rr.log("s1", rr.Scalar(2))
|
13
|
+
|
14
|
+
local = True
|
15
|
+
|
16
|
+
if local:
|
17
|
+
row = pn.Row()
|
18
|
+
# row.append(rrd_to_pane("http://localhost:8001/dat2.rrd"))
|
19
|
+
|
20
|
+
row.append(bch.rrd_to_pane("http://127.0.0.1:8001/dat2.rrd"))
|
21
|
+
row.show()
|
22
|
+
else:
|
23
|
+
# publish data to a github branch
|
24
|
+
bch.publish_and_view_rrd(
|
25
|
+
file_path,
|
26
|
+
remote="https://github.com/dyson-ai/bencher.git",
|
27
|
+
branch_name="test_rrd",
|
28
|
+
content_callback=bch.github_content,
|
29
|
+
).show()
|
@@ -0,0 +1,25 @@
|
|
1
|
+
from flask import Flask, send_from_directory
|
2
|
+
from flask_cors import CORS
|
3
|
+
import threading
|
4
|
+
from pathlib import Path
|
5
|
+
|
6
|
+
|
7
|
+
def create_server(directory):
|
8
|
+
"""Create a Flask app configured to serve files from the specified directory."""
|
9
|
+
app = Flask(__name__)
|
10
|
+
CORS(app)
|
11
|
+
|
12
|
+
@app.route("/<path:path>", methods=["GET"])
|
13
|
+
def serve_file(path):
|
14
|
+
return send_from_directory(directory, path)
|
15
|
+
|
16
|
+
return app
|
17
|
+
|
18
|
+
|
19
|
+
def run_flask_in_thread(directory=None, port=8001):
|
20
|
+
"""Run the Flask server to serve files from the specified directory."""
|
21
|
+
if directory is None:
|
22
|
+
directory = Path("cachedir/").absolute().as_posix()
|
23
|
+
app = create_server(directory)
|
24
|
+
threading.Thread(target=app.run, kwargs={"port": port}, daemon=True).start()
|
25
|
+
print(f"Flask server is running on port {port} serving files from {directory}")
|
@@ -9,6 +9,11 @@ from pathlib import Path
|
|
9
9
|
from uuid import uuid4
|
10
10
|
from functools import partial
|
11
11
|
from typing import Callable, Any, List, Tuple
|
12
|
+
import logging
|
13
|
+
import os
|
14
|
+
import tempfile
|
15
|
+
import shutil
|
16
|
+
|
12
17
|
import param
|
13
18
|
import numpy as np
|
14
19
|
|
@@ -169,6 +174,10 @@ def gen_image_path(image_name: str = "img", filetype=".png") -> str:
|
|
169
174
|
return gen_path(image_name, "img", filetype)
|
170
175
|
|
171
176
|
|
177
|
+
def gen_rerun_data_path(rrd_name: str = "rrd", filetype=".rrd") -> str:
|
178
|
+
return gen_path(rrd_name, "rrd", filetype)
|
179
|
+
|
180
|
+
|
172
181
|
def callable_name(any_callable: Callable[..., Any]) -> str:
|
173
182
|
if isinstance(any_callable, partial):
|
174
183
|
return any_callable.func.__name__
|
@@ -197,3 +206,90 @@ def get_name(var):
|
|
197
206
|
|
198
207
|
def params_to_str(param_list: List[param.Parameter]):
|
199
208
|
return [get_name(i) for i in param_list]
|
209
|
+
|
210
|
+
|
211
|
+
def publish_file(filepath: str, remote: str, branch_name: str) -> str: # pragma: no cover
|
212
|
+
"""Publish a file to an orphan git branch:
|
213
|
+
|
214
|
+
.. code-block:: python
|
215
|
+
|
216
|
+
def publish_args(branch_name) -> Tuple[str, str]:
|
217
|
+
return (
|
218
|
+
"https://github.com/dyson-ai/bencher.git",
|
219
|
+
f"https://github.com/dyson-ai/bencher/blob/{branch_name}")
|
220
|
+
|
221
|
+
|
222
|
+
Args:
|
223
|
+
remote (Callable): A function the returns a tuple of the publishing urls. It must follow the signature def publish_args(branch_name) -> Tuple[str, str]. The first url is the git repo name, the second url needs to match the format for viewable html pages on your git provider. The second url can use the argument branch_name to point to the file on a specified branch.
|
224
|
+
|
225
|
+
Returns:
|
226
|
+
str: the url of the published file
|
227
|
+
"""
|
228
|
+
|
229
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
230
|
+
shutil.copy(filepath, temp_dir)
|
231
|
+
filename = Path(filepath).name
|
232
|
+
filepath_tmp = Path(temp_dir) / filename
|
233
|
+
|
234
|
+
logging.info(f"created report at: {filepath_tmp.absolute()}")
|
235
|
+
cd_dir = f"cd {temp_dir} &&"
|
236
|
+
|
237
|
+
# create a new git repo and add files to that. Push the file to another arbitrary repo. The aim of doing it this way is that no data needs to be downloaded.
|
238
|
+
|
239
|
+
# os.system(f"{cd_dir} git config init.defaultBranch {branch_name}")
|
240
|
+
os.system(f"{cd_dir} git init")
|
241
|
+
os.system(f"{cd_dir} git branch -m {branch_name}")
|
242
|
+
os.system(f"{cd_dir} git add {filename}")
|
243
|
+
os.system(f'{cd_dir} git commit -m "publish {branch_name}"')
|
244
|
+
os.system(f"{cd_dir} git remote add origin {remote}")
|
245
|
+
os.system(f"{cd_dir} git push --set-upstream origin {branch_name} -f")
|
246
|
+
|
247
|
+
|
248
|
+
def github_content(remote: str, branch_name: str, filename: str): # pragma: no cover
|
249
|
+
raw = remote.replace(".git", "").replace(
|
250
|
+
"https://github.com/", "https://raw.githubusercontent.com/"
|
251
|
+
)
|
252
|
+
return f"{raw}/{branch_name}/{filename}?token=$(date +%s)"
|
253
|
+
|
254
|
+
|
255
|
+
# import logging
|
256
|
+
# # from rerun.legacy_notebook import as_html
|
257
|
+
# import rerun as rr
|
258
|
+
# import panel as pn
|
259
|
+
# # from .utils import publish_file, gen_rerun_data_path
|
260
|
+
|
261
|
+
|
262
|
+
# def rrd_to_pane(
|
263
|
+
# url: str, width: int = 499, height: int = 600, version: str = None
|
264
|
+
# ): # pragma: no cover
|
265
|
+
# if version is None:
|
266
|
+
# version = "-1.20.1" # TODO find a better way of doing this
|
267
|
+
# return pn.pane.HTML(
|
268
|
+
# f'<iframe src="https://app.rerun.io/version/{version}/?url={url}" width={width} height={height}></iframe>'
|
269
|
+
# )
|
270
|
+
|
271
|
+
|
272
|
+
# # def to_pane(path: str):
|
273
|
+
# # as_html()
|
274
|
+
# # return rrd_to_pane(path)
|
275
|
+
|
276
|
+
|
277
|
+
# def publish_and_view_rrd(
|
278
|
+
# file_path: str,
|
279
|
+
# remote: str,
|
280
|
+
# branch_name,
|
281
|
+
# content_callback: callable,
|
282
|
+
# version: str = None,
|
283
|
+
# ): # pragma: no cover
|
284
|
+
# as_html()
|
285
|
+
# publish_file(file_path, remote=remote, branch_name="test_rrd")
|
286
|
+
# publish_path = content_callback(remote, branch_name, file_path)
|
287
|
+
# logging.info(publish_path)
|
288
|
+
# return rrd_to_pane(publish_path, version=version)
|
289
|
+
|
290
|
+
|
291
|
+
# def record_rerun_session():
|
292
|
+
# rrd_path = gen_rerun_data_path()
|
293
|
+
# rr.save(rrd_path)
|
294
|
+
# path = rrd_path.split("cachedir")[0]
|
295
|
+
# return rrd_to_pane(f"http://126.0.0.1:8001/{path}")
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import logging
|
2
|
+
from rerun.legacy_notebook import as_html
|
3
|
+
import rerun as rr
|
4
|
+
import panel as pn
|
5
|
+
from .utils import publish_file, gen_rerun_data_path
|
6
|
+
|
7
|
+
|
8
|
+
def rrd_to_pane(
|
9
|
+
url: str, width: int = 500, height: int = 600, version: str = None
|
10
|
+
): # pragma: no cover
|
11
|
+
if version is None:
|
12
|
+
version = "0.20.1" # TODO find a better way of doing this
|
13
|
+
return pn.pane.HTML(
|
14
|
+
f'<iframe src="https://app.rerun.io/version/{version}/?url={url}" width={width} height={height}></iframe>'
|
15
|
+
)
|
16
|
+
|
17
|
+
|
18
|
+
def to_pane(path: str):
|
19
|
+
as_html()
|
20
|
+
return rrd_to_pane(path)
|
21
|
+
|
22
|
+
|
23
|
+
def publish_and_view_rrd(
|
24
|
+
file_path: str,
|
25
|
+
remote: str,
|
26
|
+
branch_name,
|
27
|
+
content_callback: callable,
|
28
|
+
version: str = None,
|
29
|
+
): # pragma: no cover
|
30
|
+
as_html()
|
31
|
+
publish_file(file_path, remote=remote, branch_name="test_rrd")
|
32
|
+
publish_path = content_callback(remote, branch_name, file_path)
|
33
|
+
logging.info(publish_path)
|
34
|
+
return rrd_to_pane(publish_path, version=version)
|
35
|
+
|
36
|
+
|
37
|
+
def capture_rerun_window(width: int = 500, height: int = 500):
|
38
|
+
rrd_path = gen_rerun_data_path()
|
39
|
+
rr.save(rrd_path)
|
40
|
+
path = rrd_path.split("cachedir")[1]
|
41
|
+
return rrd_to_pane(f"http://127.0.0.1:8001/{path}", width=width, height=height)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "holobench"
|
3
|
-
version = "1.
|
3
|
+
version = "1.31.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"
|
@@ -27,6 +27,10 @@ dependencies = [
|
|
27
27
|
"str2bool>=1.1,<=1.1",
|
28
28
|
"scoop>=0.7.0,<=0.7.2.0",
|
29
29
|
"moviepy-fix-codec",
|
30
|
+
"rerun-sdk==0.20.1",
|
31
|
+
"rerun-notebook",
|
32
|
+
"flask",
|
33
|
+
"flask-cors"
|
30
34
|
]
|
31
35
|
|
32
36
|
|
@@ -39,6 +43,9 @@ Documentation = "https://bencher.readthedocs.io/en/latest/"
|
|
39
43
|
channels = ["conda-forge"]
|
40
44
|
platforms = ["linux-64"]
|
41
45
|
|
46
|
+
[tool.pixi.system-requirements]
|
47
|
+
libc = "2.31"
|
48
|
+
|
42
49
|
[tool.pixi.feature.py310.dependencies]
|
43
50
|
python = "3.10.*"
|
44
51
|
[tool.pixi.feature.py311.dependencies]
|
@@ -103,6 +110,7 @@ update-from-template-repo = "./scripts/update_from_template.sh"
|
|
103
110
|
|
104
111
|
#demos
|
105
112
|
demo = "python3 bencher/example/example_image.py"
|
113
|
+
demo_rerun = "python3 bencher/example/example_rerun.py"
|
106
114
|
|
107
115
|
[tool.pylint]
|
108
116
|
extension-pkg-whitelist = ["numpy", "scipy"]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{holobench-1.30.3 → holobench-1.31.1}/bencher/example/experimental/example_hvplot_explorer.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|