-
Notifications
You must be signed in to change notification settings - Fork 2
140 lines (135 loc) · 4.78 KB
/
tests.yml
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
134
135
136
137
138
139
140
name: tests
on:
push:
schedule:
- cron: "0 0 * * 0" # weekly
env:
CONDA_PKGS_DIRS: /home/runner/pkgs
jobs:
test_models:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup conda
uses: s-weigand/setup-conda@v1.1.1
with:
update-conda: true
python-version: 3.7
conda-channels: anaconda, conda-forge, bioconda
- name: Create environment
run: |
conda install -n base mamba -c conda-forge
conda clean --all -y
mamba env create -f environment.yml
- name: Run tests with pytest
run: |
source activate metamers
pytest tests/test_models.py
test_snakefile:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup conda
uses: s-weigand/setup-conda@v1.1.1
with:
update-conda: true
python-version: 3.7
conda-channels: anaconda, conda-forge, bioconda
- name: Create environment
run: |
conda install -n base mamba
conda clean --all -y
mamba env create -f environment.yml
- name: Setup FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v2
- name: Download data
run: |
mkdir -p data/metamers/ref_images/
curl -O -J -L https://osf.io/4wyg3/download
tar xf textures-subset-for-testing.tar.gz -C data
rm textures-subset-for-testing.tar.gz
- name: modify config.yml
run: |
sed -i 's|DATA_DIR:.*|DATA_DIR: "data/metamers"|g' config.yml
sed -i 's|TEXTURE_DIR:.*|TEXTURE_DIR: "data/textures-subset-for-testing"|g' config.yml
- name: run snakemake test
run: |
source activate metamers
cp extra_packages/data/einstein.pgm data/metamers/ref_images/einstein_size-256,256.png
snakemake -j 5 -prk data/metamers/test_setup/RGC_norm_gaussian_gpu-0/einstein data/metamers/test_setup/V1_norm_s6_gaussian_gpu-0/einstein
run_Freeman_check_notebook:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup conda
uses: s-weigand/setup-conda@v1.1.1
with:
update-conda: true
python-version: 3.7
conda-channels: anaconda, conda-forge, bioconda
- name: Create environment
run: |
conda install -n base mamba
conda clean --all -y
mamba env create -f environment.yml
source activate metamers
mamba install jupyter nbclient>=0.5.5
- name: modify config.yml
run: |
sed -i 's|DATA_DIR:.*|DATA_DIR: "data/metamers"|g' config.yml
sed -i 's|TEXTURE_DIR:.*|TEXTURE_DIR: "data/textures-subset-for-testing"|g' config.yml
mkdir -p data/metamers
mkdir -p data/textures-subset-for-testing
- name: Download data
run : |
source activate metamers
python download_data.py freeman2011_check_output -s
python download_data.py freeman2011_check_input -s
- name: run nbconvert
run: |
source activate metamers
jupyter execute notebooks/Freeman_Check.ipynb --kernel_name=python3
test_mcmc:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup conda
uses: s-weigand/setup-conda@v1.1.1
with:
update-conda: true
python-version: 3.7
conda-channels: anaconda, conda-forge, bioconda
- name: Create environment
run: |
conda install -n base mamba
conda clean --all -y
mamba env create -f environment.yml
- name: modify config.yml
run: |
sed -i 's|DATA_DIR:.*|DATA_DIR: "data/metamers"|g' config.yml
sed -i 's|TEXTURE_DIR:.*|TEXTURE_DIR: "data/textures-subset-for-testing"|g' config.yml
mkdir -p data/metamers
mkdir -p data/textures-subset-for-testing
- name: Download data
run: |
source activate metamers
python download_data.py behavioral_data -s
- name: run mcmc test
run: |
source activate metamers
# test one that has a single subject, one with multiple
snakemake -j 5 -prk data/metamers/mcmc/V1_norm_s6_gaussian/task-split_comp-ref/task-split_comp-ref_mcmc_partially-pooled_step-1_prob-.8_depth-10_c-2_d-10_w-10_s-0.nc data/metamers/mcmc/V1_norm_s6_gaussian/task-split_comp-ref-natural/task-split_comp-ref-natural_mcmc_partially-pooled_step-1_prob-.8_depth-10_c-2_d-10_w-10_s-0.nc