Skip to content

ENH: row-major vs. column major array storage and minor enhancement to XYZ writer

username-removed-131198 requested to merge xyz-bug-fix-plain into master

This MR addresses two issues:

  1. Bug fix to array memory layout when reading from XYZ files. Use of the np.vstack() function to assemble columns read from files meant that multi-column properties (such as atomic positions) were in Fortran-contiguous memory layout, rather than the C-contiguous form preferred for efficient operation. In the patch I fix this using np.ascontiguousarray() in Atoms.new_array() if the array passed in is not C-contiguous.

  2. Minor enhancement to xyz_write() by adding an optional kwarg plain to allow writing in legacy XYZ format, rather than extended XYZ. This has recently been requested on the ASE users mailing list.

Merge request reports