#!/usr/bin/env bash # Run the full P0 pipeline: data hash check → build wells → TD QC → B2 smoke training → unit tests. set -euo pipefail cd "$(dirname "$0")/.." PY="${PY:-.venv/bin/python}" # Log + runtime: the whole pipeline goes to logs/runs/_p0/, one subdirectory per step, one row per step in # logs/index.csv (ml_porosity/runlog.py). [[ -n "${RUNLOG_DIR:-}" ]] || exec "$PY" -m ml_porosity.runlog -n p0 -- bash "scripts/$(basename "$0")" "$@" step() { "$PY" -m ml_porosity.runlog -- "$@"; } step "$PY" scripts/00_data_manifest.py --check step "$PY" scripts/01_build_wells.py step "$PY" scripts/02_td_qc.py step "$PY" scripts/03_train.py --config configs/b2_smoke.yaml step "$PY" -m pytest -q