Xyz Generator Engine Utility
Write canonical trajectory data to multi-frame XYZ files.
This module provides a lightweight exporter that converts
reaxkit.domain.data_models.TrajectoryData into standard XYZ trajectory
text. It is intended as an engine-agnostic fallback writer for workflows that
need portable trajectory output without engine-specific dependencies.
Usage context
- Workflow export: Save processed trajectories for downstream tools/inspection.
- Engine fallback: Emit XYZ when native engine writer is unavailable.
- Diagnostics: Produce human-readable trajectory snapshots over time.
Function: write_xyz_trajectory
Write a TrajectoryData object as a multi-frame XYZ file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trajectory
|
TrajectoryData
|
Canonical frame-major trajectory payload. |
required |
out_path
|
str | Path
|
Destination path for the generated XYZ trajectory file. |
required |
precision
|
int
|
Decimal precision used for coordinate formatting. |
6
|
Returns:
| Type | Description |
|---|---|
Path
|
Output file path written to disk. |
Examples:
out = write_xyz_trajectory(traj, "exports/traj.xyz", precision=8)