File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77
88[project ]
99name = " spotPython"
10- version = " 0.5.18 "
10+ version = " 0.5.19 "
1111authors = [
1212 { name =" T. Bartz-Beielstein" , email =" tbb@bartzundbartz.de" }
1313]
Original file line number Diff line number Diff line change @@ -87,3 +87,13 @@ def get_spot_tensorboard_path(experiment_name):
8787 spot_tensorboard_path = os .environ .get ("PATH_TENSORBOARD" , "runs/spot_logs/" )
8888 spot_tensorboard_path = os .path .join (spot_tensorboard_path , experiment_name )
8989 return spot_tensorboard_path
90+
91+
92+ def get_tensorboard_path (fun_control ):
93+ """Get the path to the tensorboard files.
94+ Args:
95+ fun_control (dict): The function control dictionary.
96+ Returns:
97+ tensorboard_path (str): The path to the folder where the tensorboard files are saved.
98+ """
99+ return fun_control ["TENSORBOARD_PATH" ]
Original file line number Diff line number Diff line change @@ -88,8 +88,9 @@ def fun_control_init(
8888 # if the folder "runs" exists, move it to "runs_Y_M_D_H_M_S" to avoid overwriting old tensorboard files
8989 if os .path .exists (TENSORBOARD_PATH ):
9090 now = datetime .datetime .now ()
91+ os .makedirs ("runs_OLD" , exist_ok = True )
9192 # use [:-1] to remove "/" from the end of the path
92- TENSORBOARD_PATH_OLD = TENSORBOARD_PATH [:- 1 ] + now .strftime ("%Y_%m_%d_%H_%M_%S" )
93+ TENSORBOARD_PATH_OLD = "runs_OLD/" + TENSORBOARD_PATH [:- 1 ] + "_" + now .strftime ("%Y_%m_%d_%H_%M_%S" )
9394 os .rename (TENSORBOARD_PATH [:- 1 ], TENSORBOARD_PATH_OLD )
9495 os .makedirs (TENSORBOARD_PATH , exist_ok = True )
9596 if spot_tensorboard_path is not None :
You can’t perform that action at this time.
0 commit comments