-
Notifications
You must be signed in to change notification settings - Fork 5
/
justfile
65 lines (51 loc) · 1.81 KB
/
justfile
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
# justfile for common project commands
# see here for more information: https://github.com/casey/just
# find system default shell
hashbang := if os() == 'macos' {
'/usr/bin/env zsh'
} else {
'/usr/bin/env bash'
}
# show a list of just commands for this project
default:
@just --list
# setup conda envs for this project
@setup-conda-envs:
#!{{hashbang}}
# initialize the correct shell for your machine to allow conda to work (see README for note on shell names)
conda init bash
# Check if the 'jump_sc' environment exists, and update or create accordingly
if conda env list | grep -q 'jump_sc'; then
echo "Updating 'jump_sc' environment"
conda env update -n jump_sc -f environment.yml --prune
else
echo "Creating 'jump_sc' environment"
conda env create -n jump_sc -f environment.yml
fi
# Check if the 'R_jump_sc' environment exists, and update or create accordingly
if conda env list | grep -q 'R_jump_sc'; then
echo "Updating 'R_jump_sc' environment"
conda env update -n R_jump_sc -f R_environment.yml --prune
else
echo "Creating 'R_jump_sc' environment"
conda env create -n R_jump_sc -f R_environment.yml
fi
# install kernel for use with jupyter envs
conda run -n jump_sc python -m ipykernel install --user --name jump_sc --display-name "jump_sc (Python)"
# run jupyter lab through project conda env
@run-jupyter:
#!{{hashbang}}
# open a jupyter lab session through conda env
conda run -n jump_sc jupyter lab
# run all steps
@run-all-steps:
#!{{hashbang}}
# setup conda environments
just setup-conda-envs
# run step 0.download_data
source 0.download_data/run.sh
# run step 0.download_data
@run-step-0:
#!{{hashbang}}
# run step 0.download_data
source 0.download_data/run.sh