Add per-atom information in read_structures

This MR adds the per-atom information that is parsed by read_structures as arrays to the Atoms objects that are being returned. Prior to this MR, this information was only included in the info dictionary of the Atoms object, which is also from where this information is taken by the get_parity function. Specifically, this pertains to the forces (forces_*.out) out charges (charges_*.out, bec_*.out). Possibly one should also consider per-atom information from TNEP observers (which are currently not supported afaict).

Considerations

  • Keeping per-atom information in Atoms.arrays is more consistent with the ase design.
  • It makes parsing this information more transparent.
  • When writing an Atoms object to formats with support for info dicts such as extxyz, the "comment" line (second line of extxyz) becomes very long with the current approach.
  • Having the information in both the info dict and the arrays is unnecessarily increasing the object size.

Are there other considerations/potential issues?

Todos

Decision

  • Decide whether to keep the info dict approach or move to the arrays approach (see "Considerations" above)

Dependent todos if we move to arrays

  • remove adding arrays to info dict in read_structures
  • adapt get_parity function to use information from arrays
  • add tests
  • How do we handle per-atom tensors from TNEP observers atm?
Edited by Paul Erhart

Merge request reports

Loading