-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
133 lines (110 loc) · 4.45 KB
/
Copy pathMakefile
File metadata and controls
133 lines (110 loc) · 4.45 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Makefile for New_LTPP project
# Automates installation and common tasks with pyproject.toml
.PHONY: help install install-dev lint format type-check run run-demo
# Variables
UV = uv
CLI = new-ltpp
help: ## Display available simplified commands
@echo "new_ltpp - Available commands:"
@echo ""
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "%-15s %s\n", $$1, $$2}'
install: ## Basic installation (main dependencies only)
@echo "Installing new_ltpp basic..."
@$(UV) sync
@echo "Basic installation completed!"
install-dev: ## Installation with development tools
@echo "Installing with development tools..."
@$(UV) sync --group dev
@echo "Dev installation completed!"
lint: ## Run linting (flake8)
@echo "Running flake8..."
@python -m flake8 new_ltpp/ tests/ examples/ || true
@echo "Linting finished (errors reported above)."
format: ## Format code (black + isort)
@echo "Formatting code with black and isort..."
@python -m black new_ltpp/ tests/ examples/
@python -m isort new_ltpp/ tests/ examples/
@echo "Formatting completed."
type-check: ## Type check with mypy
@echo "Running mypy type checks..."
@python -m mypy new_ltpp/ tests/ examples/ || true
@echo "Type checking finished (issues reported above)."
# Demo run target (defaults to demo/test configs)
run-demo: ## Run demo pipeline via CLI (fixed demo args)
@$(CLI) run --dataset-id test --general-specs-config quick_test \
--training-config quick_test --data-loading-config quick_test \
--simulation-config quick_test --thinning-config quick_test \
--logger-config tensorboard --model Hawkes --phase all --epochs 5
# Generic run target with defaults for real runs
run: ## Run full pipeline via CLI with real run defaults (pass variables to override)
ifndef MODEL_ID
$(error MODEL_ID is required. Usage: make run MODEL_ID=NHP DATA=hawkes1)
endif
ifndef DATA
$(error DATA is required. Usage: make run MODEL_ID=NHP DATA=hawkes1)
endif
@$(CLI) run \
$(if $(CONFIG),--config $(CONFIG),) \
--dataset-id $(DATA) \
$(if $(GENERAL_SPECS),--general-specs-config $(GENERAL_SPECS),--general-specs-config h64) \
$(if $(MODEL_SPECS),--model-specs-config $(MODEL_SPECS),) \
$(if $(TRAINING),--training-config $(TRAINING),--training-config e1000_b4) \
$(if $(DATA_LOADING),--data-loading-config $(DATA_LOADING),--data-loading-config b32_w1) \
$(if $(SIMULATION),--simulation-config $(SIMULATION),--simulation-config tw70_b15000_b32) \
$(if $(THINNING),--thinning-config $(THINNING),--thinning-config e200_s60) \
$(if $(LOGGER),--logger-config $(LOGGER),--logger-config tensorboard) \
--model $(MODEL_ID) \
$(if $(PHASE),--phase $(PHASE),--phase all) \
$(if $(EPOCHS),--epochs $(EPOCHS),--epochs 1000) \
$(if $(SAVE_DIR),--save-dir $(SAVE_DIR),) \
$(if $(DEBUG),--debug,)
benchmark-list: ## [BENCH-LIST] List available benchmarks
@$(CLI) benchmark --list
all-benchmarks: ## [BENCH-MULTI] Run benchmarks on multiple configs
@echo ">> Benchmarks multi-configurations..."
@$(CLI) benchmark \
--all --all-configs
# ---------- SYSTEM INFO ----------
info: ## [INFO] Display system and environment information
@echo ">> Informations systeme..."
@$(CLI) info \
$(if $(NODEPS),--no-deps,--deps) \
$(if $(NOHW),--no-hw,--hw) \
$(if $(OUTPUT),--output $(OUTPUT),)
# ---------- INTERACTIVE SETUP ----------
setup: ## [SETUP] Interactive setup wizard
@echo ">> Configuration interactive..."
@$(CLI) setup \
$(if $(TYPE),--type $(TYPE),--type experiment) \
$(if $(OUTPUT),--output $(OUTPUT),) \
$(if $(QUICK),--quick,)
setup-quick: ## [SETUP-Q] Quick setup mode
@make setup QUICK=1
# ---------- VERSION ----------
version: ## [VERSION] Display CLI version
@$(CLI) version
cli-help: ## [HELP] Display new_ltpp CLI help
@echo ">> Aide du CLI new_ltpp..."
@$(CLI) --help
demo: ## [DEMO] Quick demonstration of all features
@echo "=================================================="
@echo " new_ltpp DEMO - NEW CLI ARCHITECTURE"
@echo "=================================================="
@echo ""
@echo "1. System Information"
@make info
@echo ""
@echo "2. CLI Version"
@make version
@echo ""
@echo "3. Quick Training (5 epochs)"
@make run-demo EPOCHS=5
@echo ""
@echo "4. Benchmarks"
@make benchmark-list
@echo ""
@echo "=================================================="
@echo " DEMO COMPLETED!"
@echo "=================================================="
# ============================================================================
.DEFAULT_GOAL := help