File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -89,11 +89,10 @@ def process_step():
8989
9090 # preliminary value
9191 final_status = 'unconverged'
92- is_converged = False
92+ converged = False
9393
9494 try :
95- for is_converged in opt .irun (fmax = fmax , steps = steps ):
96- pass
95+ converged = opt .run (fmax = fmax , steps = steps )
9796 except Exception as exc :
9897 # label actual failed optimizations
9998 # when this happens, the atomic config somehow ends up with a 6-vector stress, which can't be
@@ -111,9 +110,9 @@ def process_step():
111110 for at in traj [0 ]:
112111 at .info ['neb_config_type' ] = 'neb_initial'
113112
114- # from value returned by Optimizer.irun (), since Optimizer.converged requires
113+ # from value returned by Optimizer.run (), since Optimizer.converged requires
115114 # a gradient as of ASE 3.26
116- if is_converged :
115+ if converged :
117116 final_status = 'converged'
118117
119118 for intermed_images in traj [1 :- 1 ]:
Original file line number Diff line number Diff line change @@ -159,9 +159,10 @@ def process_step():
159159
160160 # preliminary value
161161 final_status = 'unconverged'
162+ converged = False
162163
163164 try :
164- opt .run (fmax = fmax , smax = smax , steps = steps )
165+ converged = opt .run (fmax = fmax , smax = smax , steps = steps )
165166 except Exception as exc :
166167 # label actual failed optimizations
167168 # when this happens, the atomic config somehow ends up with a 6-vector stress, which can't be
@@ -184,9 +185,8 @@ def process_step():
184185
185186 # as of 3.26 converged() requires a gradient, but for PreconLBFGS it's not used
186187 # See https://gitlab.com/ase/ase/-/issues/1744
187- # would like to use Optimizer.irun instead, since it returns converged status, but
188- # not supported for PreconLBFGS
189- if opt .converged (None ):
188+ # use value returned by Optimizer.run() instead
189+ if converged :
190190 final_status = 'converged'
191191
192192 traj [- 1 ].info ['optimize_config_type' ] = f'optimize_last_{ final_status } '
You can’t perform that action at this time.
0 commit comments