trajectory_writer

A module containing the TrajectoryWriter class and its associated methods.

Summary

Classes:

TrajectoryWriter

A class for writing a trajectory to a file.

Reference

class TrajectoryWriter(
filename: str | None = None,
engine_format: MDEngineFormat | str = MDEngineFormat.PQ,
mode: str | FileWritingMode = 'w',
)[source]

Bases: BaseWriter

A class for writing a trajectory to a file. Inherits from BaseWriter. See BaseWriter for more information.

It can write a trajectory to a file in either a PQ format or a QMCFC format.

Parameters:
  • filename (str, optional) – The name of the file to write to. If None, the output is printed to stdout.

  • engine_format (MDEngineFormat | str, optional) – The format of the md engine for the output file. The default is MDEngineFormat.PQ.

  • mode (str, optional) – The mode of the file. Either ‘w’ for write, ‘a’ for append or ‘o’ for overwrite. The default is ‘w’.

write(
trajectory: Trajectory | AtomicSystem,
traj_type: TrajectoryFormat | str = TrajectoryFormat.XYZ,
) None[source]

Writes the trajectory to the file.

Parameters:
  • trajectory (Trajectory | AtomicSystem) – The trajectory to write.

  • traj_type (TrajectoryFormat | str, optional) – The type of the data to write to the file. Default is TrajectoryFormat.XYZ.

property format: MDEngineFormat

The format of the md engine for the output file.

Type:

MDEngineFormat

property type: TrajectoryFormat

The type of the data to write to the file.

Type:

TrajectoryFormat