-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_all.sh
More file actions
executable file
·90 lines (77 loc) · 3.69 KB
/
run_all.sh
File metadata and controls
executable file
·90 lines (77 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env bash
# ===========================================================================
# run_all.sh — Replication Package
# ===========================================================================
#
# Generates every figure in the paper from paper/data/processed_db.csv.
# Outputs go to paper/figs/ (PNGs, SVGs) and paper/figs/data/ (CSVs).
#
# Usage:
# ./run_all.sh # from the repository root
# bash run_all.sh # alternative
#
# Prerequisites:
# pip install pandas matplotlib seaborn numpy
#
# ===========================================================================
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SRC_DIR="$SCRIPT_DIR/paper/src"
# Activate the project virtualenv if it exists, so dependencies are available
if [ -f "$SCRIPT_DIR/.venv/bin/activate" ]; then
# shellcheck disable=SC1091
source "$SCRIPT_DIR/.venv/bin/activate"
fi
PYTHON="${PYTHON:-python3}"
echo "============================================================"
echo " REPLICATION PACKAGE — run_all.sh"
echo "============================================================"
echo ""
echo " Using Python: $($PYTHON --version 2>&1)"
echo " Working dir : $SCRIPT_DIR"
echo ""
# Ensure output directories exist
mkdir -p "$SCRIPT_DIR/paper/figs/data"
# ── Script registry (matches the files in paper/src/) ──────────────────────
SCRIPTS=(
"fig2_corpus.py|Figure 2 : Corpus Composition — Domain Breakdown"
"fig3ab_quadrants.py|Figure 3A-B: Quadrant Distribution — Stacked Bar Charts"
"fig3cd_scatter.py|Figure 3C-D: Radial / Starburst Scatter Charts"
"fig3e_domains.py|Figure 3E : Domain Quadrant Distribution"
"fig4ab_temporal.py|Figure 4A-B: Temporal Windows Charts"
"fig4c_temporal_frontier.py|Figure 4C : Temporal Frontier — Shifted Vectors (Mean Only)"
"fig5_frontier.py|Figure 5 : AI-Enabled Frontier — Mean Vectors"
"fig6_cones.py|Figure 6 : Expanding Cones of Possibility"
"../supplementary/src/generate_supplemental_report.py|Supplement : Supplemental Materials Report (S1-S8)"
)
SUCCESS=0
FAILED=0
for entry in "${SCRIPTS[@]}"; do
IFS='|' read -r script desc <<< "$entry"
echo ""
echo "────────────────────────────────────────────────────────────"
echo " $desc"
echo "────────────────────────────────────────────────────────────"
if "$PYTHON" "$SRC_DIR/$script"; then
SUCCESS=$((SUCCESS + 1))
else
echo " ✗ FAILED: $script"
FAILED=$((FAILED + 1))
fi
done
# ── Summary ────────────────────────────────────────────────────────────────
echo ""
echo "============================================================"
echo " COMPLETE: $SUCCESS succeeded, $FAILED failed"
echo "============================================================"
# Count outputs
FIGS_DIR="$SCRIPT_DIR/paper/figs"
DATA_DIR="$FIGS_DIR/data"
PNG_COUNT=$(find "$FIGS_DIR" -maxdepth 1 -name '*.png' 2>/dev/null | wc -l | tr -d ' ')
SVG_COUNT=$(find "$FIGS_DIR" -maxdepth 1 -name '*.svg' 2>/dev/null | wc -l | tr -d ' ')
CSV_COUNT=$(find "$DATA_DIR" -maxdepth 1 -name '*.csv' 2>/dev/null | wc -l | tr -d ' ')
echo ""
echo " Main figures : ${PNG_COUNT} PNGs, ${SVG_COUNT} SVGs"
echo " Data exports : ${CSV_COUNT} CSVs"
echo ""
echo "============================================================"