dpdata.formats.xyz package#

Submodules#

dpdata.formats.xyz.quip_gap_xyz module#

class dpdata.formats.xyz.quip_gap_xyz.QuipGapxyzSystems(file_name, **kwargs)[source]#

Bases: object

Parse an extended XYZ (QUIP/GAP) file frame by frame.

Methods

handle_single_xyz_frame(lines[, stress_sign])

Parse a single extended XYZ frame.

get_block_generator

get_block_generator()[source]#
static handle_single_xyz_frame(lines, stress_sign=-1, **kwargs)[source]#

Parse a single extended XYZ frame.

Parameters:
lineslist[str]

Raw lines for one frame (atom count + comment + atom lines).

stress_signint, optional

Sign convention for stress→virial conversion. -1 (default) follows the ASE convention: virial = -V * stress.

**kwargsdict

Additional keyword arguments (reserved for future use).

dpdata.formats.xyz.quip_gap_xyz.format_single_frame(data, frame_idx)[source]#

Format a single frame of system data into extended XYZ format lines.

Parameters:
datadict

system data

frame_idxint

frame index

Returns:
list[str]

lines for the frame

dpdata.formats.xyz.xyz module#

dpdata.formats.xyz.xyz.coord_to_xyz(coord: ndarray, types: list) str[source]#

Convert coordinates and types to xyz format.

Parameters:
coordnp.ndarray

coordinates, Nx3 array

typeslist

list of types

Returns:
str

xyz format string

Examples

>>> coord_to_xyz(np.ones((1,3)), ["C"])
1

C 1.000000 1.000000 1.000000

dpdata.formats.xyz.xyz.xyz_to_coord(xyz: str) tuple[ndarray, list][source]#

Convert xyz format to coordinates and types.

Parameters:
xyzstr

xyz format string

Returns:
coordsnp.ndarray

coordinates, Nx3 array

typeslist

list of types