set -Eeuo pipefail

# --- logging (writes next to the script) ---
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
LOG="${SCRIPT_DIR}/check_fill_value.log"
exec >>"$LOG" 2>&1
echo "=== $(date -Is) START check_fill_value ==="

# --- load python if using modules on jacta (harmless if absent) ---
if command -v module >/dev/null 2>&1; then
  module load python3/miniforge3 || true
fi

# Prefer the shared interpreter if you have one pinned; else fall back to python3
PY="${PY:-python3}"

# Default roots (override by passing --root ...)
cd "$SCRIPT_DIR"
$PY ./check_fill_value.py "$@"

echo "=== $(date -Is) END check_fill_value ==="
