OCDocker.Workbench.CampaignProgress module¶
Structured per-sample progress for vs_campaign jobs, parsed from the
job’s own stdout — no Snakemake internals, no extra process. Supports both
execution engines (see OCDocker.Workbench.Jobs): the "snakemake"
engine’s own console output (job start/finish/error blocks, X of Y steps
lines) and the "shell" engine’s [sample i/N] markers.
Text-format parsing is inherently tied to the exact wording a given tool
version prints; a future Snakemake major version could change it. When
nothing recognizable is found, this degrades to engine: "unknown" with
an empty samples mapping — never an exception.
- OCDocker.Workbench.CampaignProgress.parse_campaign_progress(log_text, *, expected_samples=None)[source]¶
Parse structured per-sample progress from a
vs_campaignjob’s log.Tries the Snakemake console-output format first, then the shell engine’s
[sample i/N]markers, and degrades toengine: "unknown"with an emptysamplesmapping for anything else — never raises.- Parameters:
log_text (str) – A tracked job’s stdout (and, for the error-block detection in the Snakemake format, ideally its stderr too — callers may concatenate both; see
OCDocker.Workbench.Jobs.JobManager.logs()).expected_samples (Sequence[str] or None) – Sample names known ahead of parsing (e.g. from the launched manifest); samples not yet mentioned in the log are reported as
"pending"instead of being omitted.
- Returns:
{"engine": "snakemake" | "shell" | "unknown", "overall": {...} | None, "samples": {name: {"status": ...}}}.- Return type:
dict[str, Any]