-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
90 lines (66 loc) · 2.1 KB
/
Makefile
File metadata and controls
90 lines (66 loc) · 2.1 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
# SecureRelayFL — reproducible workflow
# ======================================
# Quick start:
# make env # create venv + install deps
# make data # generate synthetic fault waveforms
# make baseline # train centralized baseline
# make experiments # run all FL experiments
# make figures # generate publication figures
# make all # everything end-to-end
SHELL := /bin/bash
PYTHON := python3
VENV := .venv
PIP := $(VENV)/bin/pip
PY := $(VENV)/bin/python
SEED := 42
N_SAMPLES := 1000
# ---- environment ----
.PHONY: env env-exact env-dev clean
env:
$(PYTHON) -m venv $(VENV)
$(PIP) install --upgrade pip setuptools wheel
$(PIP) install -r requirements.txt
$(PIP) install -e .
@echo ""
@echo "✓ Environment ready. Activate with: source $(VENV)/bin/activate"
env-exact:
$(PYTHON) -m venv $(VENV)
$(PIP) install --upgrade pip setuptools wheel
$(PIP) install -r requirements.lock
$(PIP) install -e .
@echo ""
@echo "✓ Environment ready (exact pins). Activate with: source $(VENV)/bin/activate"
env-dev: env
$(PIP) install -e ".[dev]"
@echo "✓ Dev dependencies installed."
# ---- data ----
.PHONY: data data-clean
data:
$(PY) data/generator/generate.py --n-samples $(N_SAMPLES) --seed $(SEED)
@echo "✓ Generated $(N_SAMPLES) samples/facility in data/generated/"
data-clean:
rm -rf data/generated/
@echo "✓ Cleaned generated data."
# ---- training (placeholders — will be filled as modules are built) ----
.PHONY: baseline experiments figures
baseline:
$(PY) -m models.train_centralized --seed $(SEED)
experiments:
$(PY) -m experiments.run_all --seed $(SEED)
figures:
$(PY) -m analysis.generate_figures
# ---- full pipeline ----
.PHONY: all
all: env data baseline experiments figures
@echo "✓ Full pipeline complete."
# ---- housekeeping ----
.PHONY: clean clean-all lint test
clean:
rm -rf data/generated/ results/ __pycache__ .pytest_cache
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
clean-all: clean
rm -rf $(VENV) *.egg-info
lint:
$(VENV)/bin/ruff check .
test:
$(VENV)/bin/pytest tests/