MCPcopy Index your code
hub / github.com/openai/plugins / execute_plan

Function execute_plan

plugins/ngs-analysis/scripts/run_amplicon_microbiome.py:824–836  ·  view source on GitHub ↗
(run_dir: Path, plan: list[dict[str, Any]])

Source from the content-addressed store, hash-verified

822
823
824def execute_plan(run_dir: Path, plan: list[dict[str, Any]]) -> dict[str, Any]:
825 for dirname in ["qiime2", "tables", "logs", "workflow"]:
826 (run_dir / dirname).mkdir(parents=True, exist_ok=True)
827 result: dict[str, Any] = {"ok": True, "steps": []}
828 for index, item in enumerate(plan, start=1):
829 step = run_cmd(["bash", "-c", item["command"]], run_dir, timeout=7200)
830 safe = item["name"].replace(":", "").replace(" ", "_").replace("/", "_")
831 write_json(run_dir / "logs" / f"{index:02d}_{safe}.json", step)
832 result["steps"].append({"name": item["name"], "ok": step.get("ok")})
833 result["ok"] = bool(result["ok"] and step.get("ok"))
834 if not step.get("ok"):
835 break
836 return result
837
838
839def write_visuals(

Callers 1

mainFunction · 0.70

Calls 3

run_cmdFunction · 0.90
write_jsonFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected