iphasimulator.trajectory_gromacs_merge

Merge restarted GROMACS trajectory and energy outputs for one simulation.

Attributes

Runner

OutputKind

INITIAL_PREFIX

CONTINUATION_PREFIX

TRAJECTORY_OUTPUT_PREFIX

Classes

DiscoveredGromacsOutputs

Raw XTC and EDR files discovered independently.

GromacsCheckResult

Result of one checked gmx check command.

GromacsMergeCommandResult

Result of one checked gmx trjcat or gmx eneconv command.

GromacsMergeOutputsResult

Structured discovery, command, and validation results.

Functions

discover_gromacs_outputs(→ DiscoveredGromacsOutputs)

Discover ordered raw XTC and EDR files without inferring their times.

maximum_trajectory_part(→ int)

Return the highest continuation number represented by XTC files.

maximum_energy_part(→ int)

Return the highest continuation number represented by EDR files.

trajectory_output_filename(→ str)

Build production_combined_00X.xtc from the highest XTC part.

energy_output_filename(→ str)

Build production_combined_00X.edr from the highest EDR part.

run_gmx_check(→ GromacsCheckResult)

Run gmx check with -f for XTC or -e for EDR.

merge_simulation_outputs(→ GromacsMergeOutputsResult)

Discover, check, merge, and validate one simulation directory.

build_argument_parser(→ argparse.ArgumentParser)

Build the command-line parser for the executable module.

main(→ int)

Command-line entry point.

Module Contents

iphasimulator.trajectory_gromacs_merge.Runner
iphasimulator.trajectory_gromacs_merge.OutputKind
iphasimulator.trajectory_gromacs_merge.INITIAL_PREFIX = 'step7_production'
iphasimulator.trajectory_gromacs_merge.CONTINUATION_PREFIX = 'step8_production_2us'
iphasimulator.trajectory_gromacs_merge.TRAJECTORY_OUTPUT_PREFIX = 'production_combined'
class iphasimulator.trajectory_gromacs_merge.DiscoveredGromacsOutputs

Raw XTC and EDR files discovered independently.

simulation_dir: pathlib.Path
xtc_files: tuple[pathlib.Path, ...]
edr_files: tuple[pathlib.Path, ...]
class iphasimulator.trajectory_gromacs_merge.GromacsCheckResult

Result of one checked gmx check command.

kind: OutputKind
path: pathlib.Path
command: tuple[str, ...]
start_time_ps: float | None
end_time_ps: float | None
stdout: str
stderr: str
class iphasimulator.trajectory_gromacs_merge.GromacsMergeCommandResult

Result of one checked gmx trjcat or gmx eneconv command.

kind: OutputKind
command: tuple[str, ...]
input_files: tuple[pathlib.Path, ...]
output_path: pathlib.Path
stdout: str
stderr: str
class iphasimulator.trajectory_gromacs_merge.GromacsMergeOutputsResult

Structured discovery, command, and validation results.

discovered: DiscoveredGromacsOutputs
trajectory_output: pathlib.Path
energy_output: pathlib.Path
input_checks: tuple[GromacsCheckResult, ...]
trajectory_merge: GromacsMergeCommandResult | None
energy_merge: GromacsMergeCommandResult | None
output_checks: tuple[GromacsCheckResult, ...]
energy_skipped_reason: str | None
dry_run: bool
iphasimulator.trajectory_gromacs_merge.discover_gromacs_outputs(simulation_dir: str | pathlib.Path) → DiscoveredGromacsOutputs

Discover ordered raw XTC and EDR files without inferring their times.

iphasimulator.trajectory_gromacs_merge.maximum_trajectory_part(xtc_files: Sequence[pathlib.Path]) → int

Return the highest continuation number represented by XTC files.

iphasimulator.trajectory_gromacs_merge.maximum_energy_part(edr_files: Sequence[pathlib.Path]) → int

Return the highest continuation number represented by EDR files.

iphasimulator.trajectory_gromacs_merge.trajectory_output_filename(xtc_files: Sequence[pathlib.Path]) → str

Build production_combined_00X.xtc from the highest XTC part.

iphasimulator.trajectory_gromacs_merge.energy_output_filename(edr_files: Sequence[pathlib.Path]) → str

Build production_combined_00X.edr from the highest EDR part.

iphasimulator.trajectory_gromacs_merge.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.

iphasimulator.trajectory_gromacs_merge.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.

iphasimulator.trajectory_gromacs_merge.build_argument_parser() → argparse.ArgumentParser

Build the command-line parser for the executable module.

iphasimulator.trajectory_gromacs_merge.main(argv: Sequence[str] | None = None) → int

Command-line entry point.