@@ -289,10 +289,12 @@ def autosave_function_restartable(
289
289
290
290
grp_restart_data .attrs ["random_noise_retries" ] = random_noise_retries
291
291
grp_restart_data .attrs ["count" ] = count
292
- grp_restart_data .attrs ["linesearch_step" ] = linesearch_step
293
292
grp_restart_data .attrs ["projector_method" ] = projector_method
294
293
grp_restart_data .attrs ["signal_reset_descent_dir" ] = signal_reset_descent_dir
295
294
295
+ if linesearch_step is not None :
296
+ grp_restart_data .attrs ["linesearch_step" ] = linesearch_step
297
+
296
298
if varipeps_config .optimizer_method is Optimizing_Methods .BFGS :
297
299
bfgs_prefactor , bfgs_B_inv = descent_method_tuple
298
300
grp_restart_data .attrs ["bfgs_prefactor" ] = bfgs_prefactor
@@ -1321,12 +1323,13 @@ def restart_from_state_file(filename: PathLike):
1321
1323
random_noise_retries = int (grp_restart_data .attrs ["random_noise_retries" ])
1322
1324
restart_state ["random_noise_retries" ] = random_noise_retries
1323
1325
restart_state ["count" ] = int (grp_restart_data .attrs ["count" ])
1324
- restart_state ["linesearch_step" ] = grp_restart_data .attrs ["linesearch_step" ]
1325
1326
restart_state ["projector_method" ] = grp_restart_data .attrs ["projector_method" ]
1326
1327
restart_state ["signal_reset_descent_dir" ] = grp_restart_data .attrs [
1327
1328
"signal_reset_descent_dir"
1328
1329
]
1329
1330
1331
+ restart_state ["linesearch_step" ] = grp_restart_data .attrs .get ("linesearch_step" )
1332
+
1330
1333
restart_state ["max_trunc_error_list" ] = {
1331
1334
k : None for k in range (random_noise_retries + 1 )
1332
1335
}
0 commit comments