iphasimulator.trajectory_gromacs_merge ====================================== .. py:module:: iphasimulator.trajectory_gromacs_merge .. autoapi-nested-parse:: Merge restarted GROMACS trajectory and energy outputs for one simulation. Attributes ---------- .. autoapisummary:: iphasimulator.trajectory_gromacs_merge.Runner iphasimulator.trajectory_gromacs_merge.OutputKind iphasimulator.trajectory_gromacs_merge.INITIAL_PREFIX iphasimulator.trajectory_gromacs_merge.CONTINUATION_PREFIX iphasimulator.trajectory_gromacs_merge.TRAJECTORY_OUTPUT_PREFIX Classes ------- .. autoapisummary:: iphasimulator.trajectory_gromacs_merge.DiscoveredGromacsOutputs iphasimulator.trajectory_gromacs_merge.GromacsCheckResult iphasimulator.trajectory_gromacs_merge.GromacsMergeCommandResult iphasimulator.trajectory_gromacs_merge.GromacsMergeOutputsResult Functions --------- .. autoapisummary:: iphasimulator.trajectory_gromacs_merge.discover_gromacs_outputs iphasimulator.trajectory_gromacs_merge.maximum_trajectory_part iphasimulator.trajectory_gromacs_merge.maximum_energy_part iphasimulator.trajectory_gromacs_merge.trajectory_output_filename iphasimulator.trajectory_gromacs_merge.energy_output_filename iphasimulator.trajectory_gromacs_merge.run_gmx_check iphasimulator.trajectory_gromacs_merge.merge_simulation_outputs iphasimulator.trajectory_gromacs_merge.build_argument_parser iphasimulator.trajectory_gromacs_merge.main Module Contents --------------- .. py:data:: Runner .. py:data:: OutputKind .. py:data:: INITIAL_PREFIX :value: 'step7_production' .. py:data:: CONTINUATION_PREFIX :value: 'step8_production_2us' .. py:data:: TRAJECTORY_OUTPUT_PREFIX :value: 'production_combined' .. py:class:: DiscoveredGromacsOutputs Raw XTC and EDR files discovered independently. .. py:attribute:: simulation_dir :type: pathlib.Path .. py:attribute:: xtc_files :type: tuple[pathlib.Path, ...] .. py:attribute:: edr_files :type: tuple[pathlib.Path, ...] .. py:class:: GromacsCheckResult Result of one checked ``gmx check`` command. .. py:attribute:: kind :type: OutputKind .. py:attribute:: path :type: pathlib.Path .. py:attribute:: command :type: tuple[str, ...] .. py:attribute:: start_time_ps :type: float | None .. py:attribute:: end_time_ps :type: float | None .. py:attribute:: stdout :type: str .. py:attribute:: stderr :type: str .. py:class:: GromacsMergeCommandResult Result of one checked ``gmx trjcat`` or ``gmx eneconv`` command. .. py:attribute:: kind :type: OutputKind .. py:attribute:: command :type: tuple[str, ...] .. py:attribute:: input_files :type: tuple[pathlib.Path, ...] .. py:attribute:: output_path :type: pathlib.Path .. py:attribute:: stdout :type: str .. py:attribute:: stderr :type: str .. py:class:: GromacsMergeOutputsResult Structured discovery, command, and validation results. .. py:attribute:: discovered :type: DiscoveredGromacsOutputs .. py:attribute:: trajectory_output :type: pathlib.Path .. py:attribute:: energy_output :type: pathlib.Path .. py:attribute:: input_checks :type: tuple[GromacsCheckResult, ...] .. py:attribute:: trajectory_merge :type: GromacsMergeCommandResult | None .. py:attribute:: energy_merge :type: GromacsMergeCommandResult | None .. py:attribute:: output_checks :type: tuple[GromacsCheckResult, ...] .. py:attribute:: energy_skipped_reason :type: str | None .. py:attribute:: dry_run :type: bool .. py:function:: discover_gromacs_outputs(simulation_dir: str | pathlib.Path) -> DiscoveredGromacsOutputs Discover ordered raw XTC and EDR files without inferring their times. .. py:function:: maximum_trajectory_part(xtc_files: Sequence[pathlib.Path]) -> int Return the highest continuation number represented by XTC files. .. py:function:: maximum_energy_part(edr_files: Sequence[pathlib.Path]) -> int Return the highest continuation number represented by EDR files. .. py:function:: trajectory_output_filename(xtc_files: Sequence[pathlib.Path]) -> str Build ``production_combined_00X.xtc`` from the highest XTC part. .. py:function:: energy_output_filename(edr_files: Sequence[pathlib.Path]) -> str Build ``production_combined_00X.edr`` from the highest EDR part. .. py:function:: run_gmx_check(path: str | pathlib.Path, *, kind: OutputKind, gmx_command: str = 'gmx', runner: Runner = subprocess.run) -> GromacsCheckResult Run ``gmx check`` with ``-f`` for XTC or ``-e`` for EDR. .. py:function:: merge_simulation_outputs(simulation_dir: str | pathlib.Path, *, dry_run: bool = False, trajectory_only: bool = False, energy_only: bool = False, skip_check: bool = False, overwrite: bool = False, gmx_command: str = 'gmx', runner: Runner = subprocess.run, stream: TextIO = sys.stdout) -> GromacsMergeOutputsResult Discover, check, merge, and validate one simulation directory. .. py:function:: build_argument_parser() -> argparse.ArgumentParser Build the command-line parser for the executable module. .. py:function:: main(argv: Sequence[str] | None = None) -> int Command-line entry point.