-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (51 loc) · 2.87 KB
/
Copy pathMakefile
File metadata and controls
71 lines (51 loc) · 2.87 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
.PHONY: all setup preprocess features train-baseline train-lstm train-transformer train-all evaluate backtest dashboard verify clean
PYTHON := python
# ── One-shot pipeline ─────────────────────────────────────────────
all: preprocess features train-all evaluate
# ── Environment ───────────────────────────────────────────────────
setup:
pip install -r requirements.txt
pip install -e ".[dev]"
pre-commit install
# ── Data pipeline ─────────────────────────────────────────────────
preprocess:
$(PYTHON) -m foresight.preprocess
features:
$(PYTHON) -m foresight.feature_engineering
# ── Modeling ──────────────────────────────────────────────────────
train-baseline:
$(PYTHON) -m foresight.train_baseline
train-lstm:
$(PYTHON) -m foresight.train_lstm
train-transformer:
$(PYTHON) -m foresight.train_transformer
train-all: train-baseline train-lstm train-transformer
evaluate:
$(PYTHON) -m foresight.evaluate
# Rolling-origin (walk-forward) backtest of XGBoost + seasonal-naive
backtest:
$(PYTHON) -m foresight.backtest
# ── Dashboard ─────────────────────────────────────────────────────
dashboard:
streamlit run dashboard/app.py
# ── Quality gates ─────────────────────────────────────────────────
lint:
ruff check src/ tests/ dashboard/
format:
ruff format src/ tests/ dashboard/
format-check:
ruff format --check src/ tests/ dashboard/
test:
pytest tests/ -v --tb=short --cov=foresight --cov-report=term-missing --cov-fail-under=20
typecheck:
mypy src/foresight
audit:
$(PYTHON) -m foresight.audit_consistency
verify: lint format-check typecheck test audit
@echo "All quality gates passed"
# ── Utilities ─────────────────────────────────────────────────────
clean:
$(PYTHON) -c "import shutil, pathlib; [shutil.rmtree(p, ignore_errors=True) for p in pathlib.Path('.').rglob('__pycache__')]"
$(PYTHON) -c "import pathlib; [p.unlink() for p in pathlib.Path('.').rglob('*.pyc')]"
$(PYTHON) -c "import shutil, pathlib; [shutil.rmtree(p, ignore_errors=True) for p in [pathlib.Path('.pytest_cache'), pathlib.Path('.ruff_cache'), pathlib.Path('lightning_logs')]]"
$(PYTHON) -c "import pathlib; [p.unlink() for p in pathlib.Path('data/processed').glob('*.csv')]"