enforce_clean_output_dir

jaxrens.cli.output_gate.enforce_clean_output_dir(working_dir, prefix, *, force)[source]

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

Parameters:
  • working_dir (Path | str) – Directory NS output files will be written to.

  • prefix (str) – out_file_prefix from the config.

  • force (bool) – When True, delete the offending files; when False, raise SystemExit(2) listing them.

Raises:

SystemExit – With code 2 when artifacts exist and force is False.

Return type:

None