Skip to content

Fix unnecessary last step in `Dynamics.irun`

Yuji Ikeda requested to merge yuzie007/ase:dynamics-irun into master

Checklist

Closes #1339 (closed)

The last yield in irun caused unnecessary one more iteration in irun, as mentioned in the issue above, which is fixed in this MR. Accordingly, the yielded value (is_converged) is carefully revisited to be an expect value.

Tests for this fix are done in three different places.

  • ase/test/optimize/test_nsteps.py (in this MR): As stated in this test before, it was questionable to have two more steps than the given steps. This MR fixes this, and correspondingly the expected results in test are also modified.
  • ase/test/optimize/test_optimizers.py (in !3071 (merged)): We should guarantee the modified irun returns True when forces are converged. The test for this is given in MR !3071 (merged).
  • ase/test/md/{test_md_logger.py,test_md_logger_interval.py} (existing): We also need to guarantee the change in this MR does not affect the number of steps dumped in logfile and trajectory. These are checked already in the existing tests.

Merge request reports