dftbplus / skprogs

Basic programs for generating Slater-Koster files for the DFTB-method
GNU Lesser General Public License v3.0
25 stars 19 forks source link

Handle non converged SCF cycles more gracefully #52

Closed vanderhe closed 1 year ago

vanderhe commented 1 year ago

At the moment, non-converged pseudo-atom calculations issue (slateratom output):

ERROR!
-> SCF is NOT converged, maximal SCF iterations exceeded.

Nevertheless this information is not processed by the sktools framework and the user will see:

.
.
File "/home/user/venvs/skprogs-devel/lib/python3.10/site-packages/sktools/calculators/slateratom.py", line 374, in __init__
  fp = open(os.path.join(self._workdir, "energies.tag"), "r")
FileNotFoundError: [Errno 2] No such file or directory: '_build/h/atom.0fo5fel_/atom0_spin/energies.tag'

It would be nice if we could provide a more useful error message in these situations, especially since MaxSCFIterations and SCFTolerance have been introduced by #43.