forked from UBC-MDS/fixml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (33 loc) · 1.51 KB
/
Makefile
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
# Reference:
# https://swcarpentry.github.io/make-novice/02-makefiles.html
# https://ubc-dsci.github.io/reproducible-and-trustworthy-workflows-for-data-science/materials/lectures/09-pipelines.html
# The .PHONY rule is used to tell make that 'all', 'clean' are not files.
.PHONY : all
# The 'all' target is the default target. It depends on 'report/docs/index.html', which triggers the build process for this file.
all : report/docs/index.html
# Unzip batch_run.zip
data/batch_run/batch_run_3.5-turbo \
data/batch_run/batch_run_4-turbo \
data/batch_run/batch_run_4o :
unzip data/batch_run/batch_run.zip -d data/batch_run/
# Preprocess
data/processed/ground_truth.csv : analysis/preprocess_batch_run_result.py data/batch_run/batch_run_3.5-turbo
python analysis/preprocess_batch_run_result.py
# Build 'report/docs/index.html' by rendering the Jupyter notebooks using Quarto.
report/docs/index.html : data/processed/ground_truth.csv
quarto render --cache-refresh
awk '{gsub(/proposal/,"final_report"); print}' ./report/docs/index.html > tmp && mv tmp ./report/docs/index.html
.PHONY : publish
publish : data/processed/ground_truth.csv
quarto publish gh-pages ./report
# The 'clean' target is used to clean up generated files and directories.
.PHONY : clean
clean :
rm -rf report/docs/*
touch report/docs/.gitkeep
rm -rf data/batch_run/batch_run_3.5-turbo
rm -rf data/batch_run/batch_run_4-turbo
rm -rf data/batch_run/batch_run_4o
rm -rf data/processed/ground_truth.csv
rm -rf data/processed/score_*csv
rm -rf report/.quarto/