runtraj.trajectories.write_trajectories#

runtraj.trajectories.write_trajectories(path, result, release, settings, met_files, metadata=None)[source]#

Write a trajectory table to a Parquet file that read_trajectories() reads alone.

trajectory and age are stored as int32. A release column holds the release id, so a scan of many files can tell releases apart. The release, the run’s settings and the met files go in the file’s metadata, with metadata, such as the settings hash.

Parameters:
  • path (str | Path | UPath) – File to write.

  • result (DataFrame) – The trajectory table (check_trajectories()).

  • release (runtraj.releases.Release) – The release the trajectories started from.

  • settings (Mapping[str, Any]) – The run’s settings, as its folder records them.

  • met_files (list[Path]) – The met files the run read.

  • metadata (Mapping[bytes, bytes] | None) – More file metadata, as {b"runtraj:...": b"..."}.

Returns:

The path written to.

Return type:

Path | UPath