-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (47 loc) · 2.96 KB
/
Copy pathMakefile
File metadata and controls
63 lines (47 loc) · 2.96 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
.PHONY: all setup data baselines gnn evaluate explain test typecheck lint format format-check verify dashboard clean
PYTHON := python
# ── One-shot pipeline ─────────────────────────────────────────────
all: data baselines gnn evaluate explain test
# ── Environment ───────────────────────────────────────────────────
setup:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt
pip install -e ".[dev]"
pre-commit install
# ── Data pipeline ─────────────────────────────────────────────────
data:
$(PYTHON) -m graphguard.download_data
$(PYTHON) -m graphguard.build_graph
# ── Modeling ──────────────────────────────────────────────────────
baselines:
$(PYTHON) -m graphguard.train_baseline
gnn:
$(PYTHON) -m graphguard.train_gnn --model all
# ── Evaluation ────────────────────────────────────────────────────
evaluate:
$(PYTHON) -m graphguard.evaluate
# ── GNN explainability (GNNExplainer) ─────────────────────────────
explain:
$(PYTHON) -m graphguard.explain_gnn
# ── Quality gates ─────────────────────────────────────────────────
test:
$(PYTHON) -m pytest tests/ -q --cov=graphguard --cov-report=term-missing --cov-fail-under=30
typecheck:
mypy src/graphguard
lint:
ruff check src/ tests/ dashboard/
format:
ruff format src/ tests/ dashboard/
format-check:
ruff format --check src/ tests/ dashboard/
verify: lint format-check typecheck test
@echo "All quality gates passed"
# ── Dashboard ─────────────────────────────────────────────────────
dashboard:
streamlit run dashboard/app.py
# ── Utilities ─────────────────────────────────────────────────────
clean:
$(PYTHON) -c "import shutil, pathlib; [shutil.rmtree(p) for p in pathlib.Path('.').rglob('__pycache__') if p.is_dir()]"
$(PYTHON) -c "import pathlib; [p.unlink() for p in pathlib.Path('.').rglob('*.pyc')]"
$(PYTHON) -c "import shutil, pathlib; [shutil.rmtree(p) for p in pathlib.Path('.').rglob('.pytest_cache') if p.is_dir()]"
$(PYTHON) -c "import shutil, pathlib; [shutil.rmtree(p) for p in pathlib.Path('.').rglob('.ruff_cache') if p.is_dir()]"