Skip to content

Commit b449c02

Browse files
0.14.69
SUMMARY_WRITER removed
1 parent 336804c commit b449c02

3 files changed

Lines changed: 9 additions & 10 deletions

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.14.67"
10+
version = "0.14.69"
1111
authors = [
1212
{ name="T. Bartz-Beielstein", email="tbb@bartzundbartz.de" }
1313
]

src/spotPython/utils/file.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ def load_experiment(PKL_NAME):
115115
Notes:
116116
The corresponding save_experiment function is part of the class spot.
117117
118+
Examples:
119+
>>> from spotPython.utils.file import load_experiment
120+
>>> spot_tuner, fun_control, design_control, surrogate_control, optimizer_control = load_experiment("spot_branin_experiment.pickle")
121+
118122
"""
119123
with open(PKL_NAME, "rb") as handle:
120124
experiment = pickle.load(handle)

src/spotPython/utils/init.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ def fun_control_init(
2323
_torchmetric=None,
2424
PREFIX="00",
2525
TENSORBOARD_CLEAN=False,
26-
SUMMARY_WRITER=False,
2726
accelerator="auto",
2827
converters=None,
2928
core_model=None,
@@ -215,10 +214,6 @@ def fun_control_init(
215214
Currently only 1-dim functions are supported. Default is `False`.
216215
shuffle (bool):
217216
Whether the data were shuffled or not. Default is None.
218-
SUMMARY_WRITER (bool):
219-
If True, the path to the folder where the spot tensorboard files are saved, i.e.,
220-
spot_tensorboard_path, is created. If spot_tensorboard_path exists,
221-
the SummaryWriter is initialized in the spot() loop. Default is False.
222217
surrogate (object):
223218
The surrogate model object. Default is None.
224219
target_column (str):
@@ -335,7 +330,7 @@ def fun_control_init(
335330
L.seed_everything(seed)
336331

337332
CHECKPOINT_PATH, DATASET_PATH, RESULTS_PATH, TENSORBOARD_PATH = setup_paths(TENSORBOARD_CLEAN)
338-
spot_tensorboard_path = create_spot_tensorboard_path(SUMMARY_WRITER, PREFIX)
333+
spot_tensorboard_path = create_spot_tensorboard_path(tensorboard_start, PREFIX)
339334

340335
if metric_sklearn is None and metric_sklearn_name is not None:
341336
metric_sklearn = get_metric_sklearn(metric_sklearn_name)
@@ -507,11 +502,11 @@ def setup_paths(tensorboard_clean) -> tuple:
507502
return CHECKPOINT_PATH, DATASET_PATH, RESULTS_PATH, TENSORBOARD_PATH
508503

509504

510-
def create_spot_tensorboard_path(summary_writer, prefix) -> str:
505+
def create_spot_tensorboard_path(tensorboard_start, prefix) -> str:
511506
"""Creates the spot_tensorboard_path and returns it.
512507
513508
Args:
514-
summary_writer (bool):
509+
tensorboard_start (bool):
515510
If True, the path to the folder where the tensorboard files are saved is created.
516511
prefix (str):
517512
The prefix for the experiment name.
@@ -520,7 +515,7 @@ def create_spot_tensorboard_path(summary_writer, prefix) -> str:
520515
spot_tensorboard_path (str):
521516
The path to the folder where the tensorboard files are saved.
522517
"""
523-
if summary_writer:
518+
if tensorboard_start:
524519
experiment_name = get_experiment_name(prefix=prefix)
525520
spot_tensorboard_path = get_spot_tensorboard_path(experiment_name)
526521
os.makedirs(spot_tensorboard_path, exist_ok=True)

0 commit comments

Comments
 (0)