phenotypic.sdk_.clear_machine_state#

phenotypic.sdk_.clear_machine_state(output_dir: Path) bool[source]#

Remove all of a run’s machine-state for a clean --restart.

Deletes current state inside .phenotypic/ (progress/, processing_state.json, processing_events.log, logs, and generated SLURM scripts) and any pre-migration root-level machine-state, while preserving _PRESERVED_ON_RESTART – the append-only terminal_failures.jsonl journal and restart_epoch.json, because a counter that resets on the operation it fences is not a fence – along with user-facing output artifacts (deliverables/, results/, qc/, …). Read that set’s membership rule before adding to it; it is now the only thing standing between --restart and every artifact under .phenotypic/. This is the difference between --restart (re-run the orchestration against clean state, keep outputs) and --overwrite (delete the whole output dir). Clearing the event log here is what stops a restart from appending to — and rebuilding its manifest/failure records from — the prior run’s events.

Returns:

True if any machine-state was removed, else False.

Parameters:

output_dir (Path)

Return type:

bool