-
Notifications
You must be signed in to change notification settings - Fork 87
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (49 loc) · 1.76 KB
/
Makefile
File metadata and controls
65 lines (49 loc) · 1.76 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
PYTHON ?= python
PIP ?= pip
.PHONY: setup fmt lint test run build ci clean help
help:
@echo "Available commands:"
@echo " setup Install dependencies"
@echo " test Run all tests"
@echo " test-quick Run quick tests only"
@echo " run-train Start model training"
@echo " run-getdata Get stock data"
@echo " run-preprocess Preprocess data"
@echo " bert-train Run BERT training"
@echo " bert-prep Run BERT data preprocess"
@echo " bert-getdata Download BERT datasets"
@echo " clean Clean generated files"
@echo " ci Run CI pipeline"
setup:
$(PIP) install -r requirements.txt
@echo "Setup completed. Recommend using conda environment: stock_prediction"
fmt:
@echo "Code formatting (placeholder - add black/ruff if needed)"
lint:
@echo "Code linting (placeholder - add ruff/mypy if needed)"
test:
$(PYTHON) -m pytest -v
test-quick:
$(PYTHON) -m pytest tests/test_import.py tests/test_config.py -v
run-train:
$(PYTHON) scripts/predict.py --mode train --model transformer --epochs 5
run-getdata:
$(PYTHON) scripts/getdata.py --api akshare --code ""
run-preprocess:
$(PYTHON) scripts/data_preprocess.py --pklname train.pkl
# BERT related helpers
bert-train:
$(PYTHON) bert_train.py --batch_size 8 --nepoch 3
bert-prep:
$(PYTHON) bert_data_preprocess.py
bert-getdata:
$(PYTHON) get_bert_data.py
build:
@echo "No build step required for pure Python project"
clean:
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
find . -type f -name "*.pyo" -delete 2>/dev/null || true
find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
ci: fmt lint test build
@echo "CI pipeline completed successfully"