-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (55 loc) · 2.4 KB
/
Makefile
File metadata and controls
75 lines (55 loc) · 2.4 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
#################################################################################
# GLOBALS #
#################################################################################
PROJECT_NAME = UMA-random_forest-SVM
PYTHON_VERSION = 3.12
#################################################################################
# COMMANDS #
#################################################################################
## Install Python Dependencies
.PHONY: requirements
requirements:
pip install uv
uv sync
## Delete all compiled Python files
.PHONY: clean
clean:
find . -type f -name "*.py[co]" -delete
find . -type d -name "__pycache__" -delete
## Lint using flake8 and black (use `make format` to do formatting)
.PHONY: lint
lint:
uv run flake8 random_forest_svm
uv run isort --check --diff --profile black random_forest_svm/
uv run black --check --config pyproject.toml random_forest_svm/
## Format source code with black
.PHONY: format
format:
uv run black --config pyproject.toml random_forest_svm
## Download and preprocess data
.PHONY: prepare_data
prepare_data:
uv run python random_forest_svm/data/download_data.py
uv run python random_forest_svm/data/preprocess_data.py
## Perform experiments
.PHONY: run_experiments
run_experiments:
uv run python random_forest_svm/experiments/comparative_experiment.py
uv run python random_forest_svm/experiments/perform_hyperparameters_experiment.py
#################################################################################
# PROJECT RULES #
#################################################################################
#################################################################################
# Self Documenting Commands #
#################################################################################
.DEFAULT_GOAL := help
define PRINT_HELP_PYSCRIPT
import re, sys; \
lines = '\n'.join([line for line in sys.stdin]); \
matches = re.findall(r'\n## (.*)\n[\s\S]+?\n([a-zA-Z_-]+):', lines); \
print('Available rules:\n'); \
print('\n'.join(['{:25}{}'.format(*reversed(match)) for match in matches]))
endef
export PRINT_HELP_PYSCRIPT
help:
@uv run python -c "${PRINT_HELP_PYSCRIPT}" < $(MAKEFILE_LIST)