Skip to content

Commit c7e9ea9

Browse files
tensorboard process handling
1 parent d39371a commit c7e9ea9

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77

88
[project]
99
name = "spotPython"
10-
version = "0.6.21"
10+
version = "0.6.22"
1111
authors = [
1212
{ name="T. Bartz-Beielstein", email="tbb@bartzundbartz.de" }
1313
]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import subprocess
2+
3+
4+
def start_tensorboard() -> subprocess.Popen:
5+
"""Starts a tensorboard server in the background.
6+
7+
Returns:
8+
process: The process of the tensorboard server.
9+
10+
Examples:
11+
>>> process = start_tensorboard()
12+
13+
"""
14+
cmd = ["tensorboard", "--logdir=./runs"]
15+
process = subprocess.Popen(cmd)
16+
return process
17+
18+
19+
def stop_tensorboard(process) -> None:
20+
"""Stops a tensorboard server.
21+
22+
Args:
23+
process: The process of the tensorboard server.
24+
25+
Returns:
26+
None
27+
28+
Examples:
29+
>>> process = start_tensorboard()
30+
>>> stop_tensorboard(process)
31+
"""
32+
process.terminate()

0 commit comments

Comments
 (0)