@@ -141,22 +141,22 @@ def load_result(PREFIX) -> tuple:
141141 if PREFIX is None :
142142 raise ValueError ("No PREFIX provided." )
143143 filename = get_result_filename (PREFIX )
144- spot_tuner , fun_control , design_control , surrogate_control , optimizer_control = load_experiment (PKL_NAME = filename )
144+ spot_tuner , fun_control , design_control , surrogate_control , optimizer_control = load_experiment (filename = filename )
145145 return spot_tuner , fun_control , design_control , surrogate_control , optimizer_control
146146
147147
148- def load_experiment (PREFIX = None , PKL_NAME = None ):
148+ def load_experiment (PREFIX = None , filename = None ):
149149 """
150150 Loads the experiment from a pickle file.
151- If PKL_NAME is None and PREFIX is not None, the experiment is loaded based on the PREFIX
151+ If filename is None and PREFIX is not None, the experiment is loaded based on the PREFIX
152152 using the get_experiment_filename function.
153153 If the spot tuner object and the fun control dictionary do not exist, an error is thrown.
154154 If the design control, surrogate control, and optimizer control dictionaries do not exist, a warning is issued
155155 and `None` is assigned to the corresponding variables.
156156
157157 Args:
158158 PREFIX (str, optional): Prefix of the experiment. Defaults to None.
159- PKL_NAME (str): Name of the pickle file. Defaults to None.
159+ filename (str): Name of the pickle file. Defaults to None.
160160
161161 Returns:
162162 spot_tuner (object): The spot tuner object.
@@ -170,14 +170,14 @@ def load_experiment(PREFIX=None, PKL_NAME=None):
170170
171171 Examples:
172172 >>> from spotpython.utils.file import load_experiment
173- >>> spot_tuner, fun_control, design_control, _, _ = load_experiment(PKL_NAME ="RUN_0.pkl")
173+ >>> spot_tuner, fun_control, design_control, _, _ = load_experiment(filename ="RUN_0.pkl")
174174
175175 """
176- if PKL_NAME is None and PREFIX is not None :
177- PKL_NAME = get_experiment_filename (PREFIX )
178- with open (PKL_NAME , "rb" ) as handle :
176+ if filename is None and PREFIX is not None :
177+ filename = get_experiment_filename (PREFIX )
178+ with open (filename , "rb" ) as handle :
179179 experiment = pickle .load (handle )
180- print (f"Loaded experiment from { PKL_NAME } " )
180+ print (f"Loaded experiment from { filename } " )
181181 # assign spot_tuner and fun_control only if they exist otherwise throw an error
182182 if "spot_tuner" not in experiment :
183183 raise ValueError ("The spot tuner object does not exist in the pickle file." )
@@ -283,11 +283,11 @@ def get_experiment_from_PREFIX(PREFIX, return_dict=True) -> dict:
283283 return config , fun_control , design_control , surrogate_control , optimizer_control
284284
285285
286- def load_and_run_spot_python_experiment (spot_pkl_name ) -> tuple :
286+ def load_and_run_spot_python_experiment (spot_filename ) -> tuple :
287287 """Loads and runs a spot experiment.
288288
289289 Args:
290- spot_pkl_name (str):
290+ spot_filename (str):
291291 The name of the spot experiment file.
292292
293293 Returns:
@@ -305,7 +305,7 @@ def load_and_run_spot_python_experiment(spot_pkl_name) -> tuple:
305305
306306 """
307307 p_open = None
308- (spot_tuner , fun_control , design_control , surrogate_control , optimizer_control ) = load_experiment (spot_pkl_name )
308+ (spot_tuner , fun_control , design_control , surrogate_control , optimizer_control ) = load_experiment (spot_filename )
309309 print ("\n Loaded fun_control in spotRun():" )
310310 # pprint.pprint(fun_control)
311311 print (gen_design_table (fun_control ))
0 commit comments