-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (48 loc) 路 1.83 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Check that given variables are set and all have non-empty values,
# die with an error otherwise.
#
# Params:
# 1. Variable name(s) to test.
# 2. (optional) Error message to print.
#
# https://stackoverflow.com/a/10858332
check_defined = \
$(strip $(foreach 1,$1, \
$(call __check_defined,$1,$(strip $(value 2)))))
__check_defined = \
$(if $(value $1),, \
$(error Undefined $1$(if $2, ($2))))
# Run all tests
test:
@python3 -m unittest discover tests/
# Run the main pipeline for supernovae
pipeline:
@:$(call check_defined, EPOCH) # ensure that the EPOCH is specified before starting the pipeline
scripts/build_catalog_db.py
scripts/cross_match.py
rm -rf "resources/images/epoch${EPOCH}_categorized"
rm -rf "resources/images/epoch${EPOCH}_cross_matches"
mkdir "resources/images/epoch${EPOCH}_categorized"
mkdir "resources/images/epoch${EPOCH}_cross_matches"
scripts/image_driver.sh
scripts/prepare_categories.py "resources/images/epoch${EPOCH}_cross_matches" "resources/images/epoch${EPOCH}_categorized"
# Run the pipeline for TDEs
tde:
@:$(call check_defined, EPOCH) # ensure that the EPOCH is specified
scripts/build_catalog_db.py --no-sne --tde
scripts/cross_match.py --no-sne --tde
rm -rf "resources/images/epoch${EPOCH}_cross_matches_tde"
mkdir "resources/images/epoch${EPOCH}_cross_matches_tde"
DISPLAY= scripts/make_images.py --no-sne --tde 0 0 # the start and count arguments don't matter here
# Visualize package dependency tree.
# `pipdeptree` must be installed and in the $PATH.
tree:
@pipdeptree --python `whereis -q python`
# Send changes to Quest mirror
put:
rsync -vhra . ${QUEST_PROJECT_DIR} --include='**.gitignore' --exclude='/.git' --filter=':- .gitignore'
clean:
# Delete all __pycache__ folders
find . -type d -name __pycache__ -exec rm -r {} \+
# Delete logs
$(RM) -f resources/logs/*.txt