matscipy.io.lammpsdata

Helper class LAMMPSData to read/write LAMMPS text files.

Functions

check_legal_name(func)

Check proper dataset name.

column_size(dtype)

Compute number of columns from dtype.

read_molecules_from_lammps_data(fd[, style])

Read molecules information from LAMMPS data file.

Classes

LAMMPSData([style, image_flags])

Main class to interact with LAMMPS text files.

matscipy.io.lammpsdata.read_molecules_from_lammps_data(fd: str | PathLike | TextIOBase, style='full')

Read molecules information from LAMMPS data file.

Parameters:
  • fd – File descriptor, i.e. file path or text stream.

  • style – LAMMPS atomic style.

Returns:

An object containing the molecule connectivity data.

Return type:

Molecules

Notes

For the connectivity data to make sense with atoms ids read by ASE, the sort_by_id flag of read() must be set to True.

Check proper dataset name.

matscipy.io.lammpsdata.column_size(dtype: dtype)

Compute number of columns from dtype.

class matscipy.io.lammpsdata.LAMMPSData(style='atomic', image_flags=False)

Bases: object

Main class to interact with LAMMPS text files.

Methods

read(fd)

Read data from text file or stream.

write(fd)

Write data to text file or stream.

__init__(style='atomic', image_flags=False)

Initialize data object with atom style.

write(fd: str | PathLike | TextIOBase)

Write data to text file or stream.

read(fd: str | PathLike | TextIOBase)

Read data from text file or stream.