hplattice.Trajectory

class hplattice.Trajectory.Trajectory(save_trajectory, trajectory_filename, open_stream_fcn=<function open_file_stream>)[source]

Trajectory objects write chain coordinates to output streams. They used to record the progress of an enumeration or monte carlo simulation.

Parameters:
  • save_trajectory (bool) – True if trajectory should be saved to output stream.
  • trajectory_filename (str) – write trajectory to this path
  • open_stream_fcn (callable) – optional, call this function to open an output stream
finalize()[source]

Close any open output streams.

snapshot(chain)[source]

Record coordinates of chain to output stream.

Parameters:chain (hplattice.Chain.Chain) – Save coords of this chain.
hplattice.Trajectory.open_file_stream(filename)[source]

Helper function to open a file for writing.

Parameters:filename (str) – open this path for writing