Too large energies printed in siesta made sisl crash #482
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When SIESTA has to print an energy value that it is too large to be formatted, it prints
**********************
. This was makingoutSileSiesta.read_energy()
fail in those cases, since it was trying to convert the string to a float. In my case the very large energy was the ion-electron energy, and although I only cared about the total energy it reads all of them and crashes because it can not read a particular one.With this commit when the energy can not be parsed to float
np.nan
is asigned. We could check for asterisks in the string, but I think that would be a waste of time. Also, I didn't know whether to choosenp.inf
overnp.nan
. The problem is that the sign of the "infinite" value is unknown and it is not really infinite, so I thinknp.nan
is better.