I’ve been using ase in python scripts to read a number of files, including .extxyz, and it looks like the behavior for ase.io.read(…format=‘extxyz’) has changed, and I’m not sure where to find the key-value pairs from the header in the resulting Atoms object.
The headers in this file look like:
Lattice="13.3519 0.0 0.0 0.0 13.3519 0.0 0.0 0.0 13.3519" Properties=species:S:1:pos:R:3 name=C216Li24-15 energy=-1728.48358344 pbc="T T T"
Using ase-3.22.1, I can call atoms_object.info
and I get
{'name': 'C216Li24-15', 'energy': -1728.48358344}
But using ase-3.23.0, I get only
{'name': 'C216Li24-15'}
Is ‘energy’ being stored somewhere else, like in a calculator object?
Thanks!
It is being stored in a calculator object; try using atoms.get_potential_energy()
or looking at atoms.calc.results
.
This change in behaviour is to avoid ambiguity/conflict when equivalent information is placed on both the atoms and its Calculator.
Ah, thank you! I thought I had tried get_potential_energy, but that is indeed what I needed.