#!/usr/bin/env bash # Run the full P0 pipeline: data hash check → inventory → DDR XML parse → render QC → OCR pilot → OCR QC → unit tests. # The OCR pilot sends nothing once its 47 pages are in the page cache (outputs/ocr/pages/); the full OCR run # (scripts/04_ocr.py --all, ~5.3 h) is not part of P0: run it detached, see README. 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 # Log + runtime: the whole pipeline goes to logs/runs/_p0/, one subdirectory per step, one row per step in # logs/index.csv (volve_dia/runlog.py). [[ -n "${RUNLOG_DIR:-}" ]] || exec "$PY" -m volve_dia.runlog -n p0 -- bash "scripts/$(basename "$0")" "$@" step() { "$PY" -m volve_dia.runlog -- "$@"; } step "$PY" scripts/00_data_manifest.py --check step "$PY" scripts/01_inventory.py step "$PY" scripts/02_parse_ddr.py step "$PY" scripts/03_render_qc.py step "$PY" scripts/04_ocr.py --pilot step "$PY" scripts/05_ocr_qc.py step "$PY" -m pytest -q