Spaces:
Sleeping
Sleeping
| # Run chart-only generation for the pie/donut chart_type whitelist over both | |
| # data pools. Designed to be launched inside a tmux session so it can run | |
| # unattended for hours. | |
| # | |
| # Whitelist (allowed_chart_types.json) must contain: | |
| # {"chart_types": ["donut chart","pie chart","multiple donut chart","multiple pie chart"]} | |
| # | |
| # Outputs: | |
| # output/pie_donut_chart_only/<pool_basename>/ -> final svg + png | |
| # logs/pie_donut_<pool_basename>.log -> pipeline stdout/stderr | |
| set -u | |
| set -o pipefail | |
| cd "$(dirname "$0")/.." | |
| ROOT="$(pwd)" | |
| echo "[run_pie_donut] cwd=$ROOT" | |
| if [[ ! -s allowed_chart_types.json ]]; then | |
| echo "[run_pie_donut] ERROR: allowed_chart_types.json missing or empty" >&2 | |
| exit 1 | |
| fi | |
| echo "[run_pie_donut] whitelist:" | |
| cat allowed_chart_types.json | |
| echo | |
| export PUPPETEER_EXECUTABLE_PATH="${PUPPETEER_EXECUTABLE_PATH:-/usr/bin/google-chrome}" | |
| THREADS="${THREADS:-32}" | |
| echo "[run_pie_donut] PUPPETEER_EXECUTABLE_PATH=$PUPPETEER_EXECUTABLE_PATH" | |
| echo "[run_pie_donut] THREADS=$THREADS" | |
| echo | |
| mkdir -p logs output/pie_donut_chart_only | |
| POOLS=( | |
| /data/liduan/resources/claude_data_v2 | |
| /data/liduan/resources/claude_new | |
| ) | |
| OVERALL_START=$(date +%s) | |
| for pool in "${POOLS[@]}"; do | |
| name="$(basename "$pool")" | |
| out="output/pie_donut_chart_only/$name" | |
| log="logs/pie_donut_${name}.log" | |
| echo "============================================================" | |
| echo "[run_pie_donut] pool=$pool" | |
| echo "[run_pie_donut] out =$out" | |
| echo "[run_pie_donut] log =$log" | |
| echo "[run_pie_donut] starting at $(date -Iseconds)" | |
| echo "============================================================" | |
| mkdir -p "$out" | |
| python pipeline.py \ | |
| --input "$pool" \ | |
| --output "$out" \ | |
| --modules infographics_generator \ | |
| --chart-only --output-png \ | |
| --threads "$THREADS" \ | |
| 2>&1 | tee "$log" | |
| echo "[run_pie_donut] finished $name at $(date -Iseconds)" | |
| done | |
| OVERALL_END=$(date +%s) | |
| echo "[run_pie_donut] ALL DONE in $((OVERALL_END - OVERALL_START))s" | |