#!/usr/bin/env bash # Run the M1 pipeline on top of P0 (scripts/run_p0.sh must have built outputs/ddr/): # OCR hub import -> OCR QC on the hub pages -> WITSML parse -> labels T1-T3 -> T4 questions -> T4 raw-XML check # -> trial audit sample -> unit tests. # The hub import needs the Dataset Hub export under data/ocr_hub/ (configs/ocr_hub.yaml; download it as in README); # without it that step and the QC on the hub pages are skipped. WITSML parsing reads about 20 GB and takes the longest. set -euo pipefail cd "$(dirname "$0")/.." PY="${PY:-.venv/bin/python}" # Unconditional: the machine default is OMP/MKL/OPENBLAS_NUM_THREADS=40, and "${VAR:-4}" would keep that 40. export OMP_NUM_THREADS=4 MKL_NUM_THREADS=4 OPENBLAS_NUM_THREADS=4 [[ -n "${RUNLOG_DIR:-}" ]] || exec "$PY" -m volve_dia.runlog -n m1 -- bash "scripts/$(basename "$0")" "$@" step() { "$PY" -m volve_dia.runlog -- "$@"; } if compgen -G "data/ocr_hub/*" > /dev/null; then step "$PY" scripts/04_ocr_hub.py step "$PY" scripts/05_ocr_qc.py --source hub else echo "[m1] data/ocr_hub/ is empty: OCR hub import and its QC skipped" fi step "$PY" scripts/06_parse_witsml.py --workers 4 step "$PY" scripts/07_labels.py step "$PY" scripts/08_t4_questions.py step "$PY" scripts/08_t4_xml_check.py step "$PY" scripts/09_audit.py sample step "$PY" -m pytest -q