-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (64 loc) · 2.93 KB
/
Copy pathMakefile
File metadata and controls
80 lines (64 loc) · 2.93 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
PYTHON := uv run python
SOURCE_DATE_EPOCH := 1786960800
export SOURCE_DATE_EPOCH
.PHONY: sync format lint test build theory oracle estimated analyze reproduce check-generated paper research-check check clean
sync:
uv sync --all-groups --all-extras
format:
uv run ruff check --fix src experiments tests
uv run ruff format src experiments tests
lint:
uv run ruff check src experiments tests
uv run ruff format --check src experiments tests
uv run pyright
uvx --from pydoclint==0.9.1 pydoclint src/
test:
$(PYTHON) -m pytest -q
build:
uv build
theory:
$(PYTHON) -m experiments.check_theory
oracle:
$(PYTHON) -m experiments.run_oracle --outdir results/oracle
estimated:
$(PYTHON) -m experiments.run_estimated --outdir results/estimated
analyze:
MPLCONFIGDIR=/tmp/queue-shift-matplotlib $(PYTHON) -m experiments.analyze_oracle \
results/oracle \
--out results/oracle_summary.csv \
--tex paper/generated/oracle_summary.tex \
--figure paper/figures/oracle_frontier.pdf \
--macros paper/generated/oracle_numbers.tex
MPLCONFIGDIR=/tmp/queue-shift-matplotlib $(PYTHON) -m experiments.analyze_estimated \
results/estimated \
--out results/estimated_summary.csv \
--tex paper/generated/estimated_summary.tex \
--figure paper/figures/estimated_validation.pdf \
--macros paper/generated/estimated_numbers.tex
reproduce: oracle estimated analyze
check-generated:
@tmp=$$(mktemp -d) && \
MPLCONFIGDIR=/tmp/queue-shift-matplotlib $(PYTHON) -m experiments.analyze_oracle \
results/oracle --out $$tmp/oracle_summary.csv --tex $$tmp/oracle_summary.tex \
--figure $$tmp/oracle_frontier.pdf --macros $$tmp/oracle_numbers.tex >/dev/null && \
MPLCONFIGDIR=/tmp/queue-shift-matplotlib $(PYTHON) -m experiments.analyze_estimated \
results/estimated --out $$tmp/estimated_summary.csv --tex $$tmp/estimated_summary.tex \
--figure $$tmp/estimated_validation.pdf --macros $$tmp/estimated_numbers.tex >/dev/null && \
diff -q results/oracle_summary.csv $$tmp/oracle_summary.csv && \
diff -q results/estimated_summary.csv $$tmp/estimated_summary.csv && \
diff -q paper/generated/oracle_summary.tex $$tmp/oracle_summary.tex && \
diff -q paper/generated/estimated_summary.tex $$tmp/estimated_summary.tex && \
diff -q paper/generated/oracle_numbers.tex $$tmp/oracle_numbers.tex && \
diff -q paper/generated/estimated_numbers.tex $$tmp/estimated_numbers.tex && \
rm -rf $$tmp && echo "generated results are synchronized"
paper:
cd paper && pdflatex -interaction=nonstopmode main.tex >/dev/null
cd paper && bibtex main >/dev/null
cd paper && pdflatex -interaction=nonstopmode main.tex >/dev/null
cd paper && pdflatex -interaction=nonstopmode main.tex >/dev/null
@! grep -qE "Undefined control sequence|Citation .* undefined|Reference .* undefined" paper/main.log
@echo "built paper/main.pdf"
research-check: theory check-generated paper
check: lint test build research-check
clean:
rm -f paper/main.aux paper/main.bbl paper/main.blg paper/main.log paper/main.out