jaxrens.cli.output_gate

Output-dir safety gate and restart-checkpoint discovery for jaxrens run.

The gate refuses to start when working_dir already holds artifacts matching the configured out_file_prefix — without it, re-running the same config against the same output dir silently truncates .energies and concatenates duplicate frames into .traj.extxyz.

The same prefix-aware globbing is reused by discover_checkpoint() for the --resume (auto-restart) flow, which looks up a checkpoint in working_dir instead of taking an explicit path from the YAML.

Functions

discover_checkpoint

Pick the checkpoint to restart from in working_dir.

enforce_clean_output_dir

Abort the run (or wipe artifacts) if working_dir is dirty.

read_config_snapshot

Load a previously-written config snapshot YAML into a dict.

snapshot_filename

The fixed filename a fresh jaxrens run writes its config to.

snapshot_path_for_checkpoint

Locate the snapshot YAML that should sit next to a checkpoint.

write_config_snapshot

Dump the validated root config to {prefix}.config.snapshot.yaml.