File size: 1,426 Bytes
aefa98b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""Run pipeline steps in order.  Usage: python src/run_pipeline.py [--steps 01 02 ...] [--force]

Each step module is idempotent and writes to artifacts/stepNN/. Steps are registered in STEPS below.
"""
import argparse, importlib, sys, os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
STEPS = {
    "01": "pipeline.step01_csv_to_parquet",
    "02": "pipeline.step02_inventory",
    "03": "pipeline.step03_source_attribution",
    "04": "pipeline.step04_class_by_source",
    "05": "pipeline.step05_duplicates",
    "06": "pipeline.step06_source_probe",
    "07a": "pipeline.step07a_taxonomy_attack",
    "07": "pipeline.step07_splits",
    "08": "pipeline.step08_baselines",
    "08b": "pipeline.step08b_order_noise",
    "09": "pipeline.step09_imbalance",
    "10": "pipeline.step10_learning_curve",
    "11": "pipeline.step11_hierarchy",
    "12": "pipeline.step12_report",
    # 02 inventory, 03 source attribution, 04 class x source, 05 duplicates, 06 source probe,
    # 07 split protocols, 08 baselines, 09 imbalance, 10 learning curve, 11 hierarchy: added as implemented
}
if __name__ == "__main__":
    ap = argparse.ArgumentParser(); ap.add_argument("--steps", nargs="*", default=list(STEPS)); ap.add_argument("--force", action="store_true")
    a = ap.parse_args()
    for s in a.steps:
        print(f"===== STEP {s} =====", flush=True)
        importlib.import_module(STEPS[s]).run(force=a.force)