|
a |
|
b/.github/workflows/python-testing.yml |
|
|
1 |
--- |
|
|
2 |
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
|
|
3 |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
|
|
4 |
|
|
|
5 |
name: Lint and test workflow |
|
|
6 |
on: |
|
|
7 |
push: |
|
|
8 |
workflow_dispatch: |
|
|
9 |
|
|
|
10 |
jobs: |
|
|
11 |
quality: |
|
|
12 |
runs-on: ubuntu-latest |
|
|
13 |
|
|
|
14 |
steps: |
|
|
15 |
- name: Install non-python dependencies |
|
|
16 |
run: | |
|
|
17 |
sudo apt-get install -y graphviz-dev |
|
|
18 |
|
|
|
19 |
- name: Setup Python environment |
|
|
20 |
uses: khanlab/actions/.github/actions/action-setup_task-installPyProject@v0.3.2 |
|
|
21 |
with: |
|
|
22 |
python-version: "3.9" |
|
|
23 |
|
|
|
24 |
- name: isort |
|
|
25 |
run: poetry run isort hippunfold/*.py -c |
|
|
26 |
|
|
|
27 |
- name: Black |
|
|
28 |
run: poetry run black hippunfold --check |
|
|
29 |
|
|
|
30 |
- name: snakefmt |
|
|
31 |
run: poetry run snakefmt hippunfold --check |
|
|
32 |
|
|
|
33 |
test: |
|
|
34 |
runs-on: ubuntu-latest |
|
|
35 |
needs: ["quality"] |
|
|
36 |
strategy: |
|
|
37 |
matrix: |
|
|
38 |
python-version: ["3.8", "3.9"] |
|
|
39 |
|
|
|
40 |
steps: |
|
|
41 |
- name: Install non-python dependencies |
|
|
42 |
run: | |
|
|
43 |
sudo apt-get install -y graphviz-dev |
|
|
44 |
|
|
|
45 |
- name: Set up Python ${{ matrix.python-version }} |
|
|
46 |
uses: actions/setup-python@v3 |
|
|
47 |
with: |
|
|
48 |
python-version: ${{ matrix.python-version }} |
|
|
49 |
|
|
|
50 |
- name: Setup Python environments |
|
|
51 |
uses: khanlab/actions/.github/actions/action-setup_task-installPyProject@v0.3.2 |
|
|
52 |
with: |
|
|
53 |
python-version: ${{ matrix.python-version }} |
|
|
54 |
install-library: true |
|
|
55 |
|
|
|
56 |
- name: Setup env for hippunfold |
|
|
57 |
run: | |
|
|
58 |
echo "HIPPUNFOLD_CACHE_DIR=`pwd`/test_data/hippunfold_cache_dir" >> $GITHUB_ENV |
|
|
59 |
|
|
|
60 |
- name: Test single T2w bids |
|
|
61 |
run: | |
|
|
62 |
poetry run hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w |
|
|
63 |
|
|
|
64 |
- name: Test running on existing folder |
|
|
65 |
run: | |
|
|
66 |
mkdir test_newout |
|
|
67 |
poetry run hippunfold test_data/bids_singleT2w test_newout participant -np --modality T2w |
|
|
68 |
|
|
|
69 |
- name: Test single T2w bids, right hemi |
|
|
70 |
run: | |
|
|
71 |
poetry run hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w --hemi R |
|
|
72 |
|
|
|
73 |
- name: Test single T2w bids, left hemi |
|
|
74 |
run: | |
|
|
75 |
poetry run hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w --hemi L |
|
|
76 |
|
|
|
77 |
- name: Test multiple T2w bids |
|
|
78 |
run: | |
|
|
79 |
poetry run hippunfold test_data/bids_multiT2w test_out participant -np --modality T2w |
|
|
80 |
|
|
|
81 |
- name: Test T1w bids |
|
|
82 |
run: | |
|
|
83 |
poetry run hippunfold test_data/bids_T1w test_out participant -np --modality T1w |
|
|
84 |
|
|
|
85 |
- name: Test hipp b500 bids |
|
|
86 |
run: | |
|
|
87 |
poetry run hippunfold test_data/bids_hippb500 test_out participant -np --modality hippb500 |
|
|
88 |
|
|
|
89 |
- name: Test T1w multi-session/longitudinal bids |
|
|
90 |
run: | |
|
|
91 |
poetry run hippunfold test_data/bids_T1w_longitudinal test_out participant -np --modality T1w |
|
|
92 |
|
|
|
93 |
- name: Test single T2w multi-session/longitudinal bids |
|
|
94 |
run: | |
|
|
95 |
poetry run hippunfold test_data/bids_singleT2w_longitudinal test_out participant -np --modality T2w |
|
|
96 |
|
|
|
97 |
- name: Test manual seg T2w bids |
|
|
98 |
run: | |
|
|
99 |
poetry run hippunfold test_data/bids_segT2w test_out participant -np --modality segT2w |
|
|
100 |
|
|
|
101 |
- name: Test cropseg bids, with path override |
|
|
102 |
run: | |
|
|
103 |
poetry run hippunfold . test_out participant -np --modality cropseg --path_cropseg test_data/data_cropseg/sub-{subject}_hemi-{hemi}_dseg.nii.gz |
|
|
104 |
|
|
|
105 |
- name: Test cropseg bids, with path override, left hemi |
|
|
106 |
run: | |
|
|
107 |
poetry run hippunfold . test_out participant -np --modality cropseg --path_cropseg test_data/data_cropseg_1hemi/sub-{subject}_hemi-{hemi}_dseg.nii.gz --hemi L |
|
|
108 |
|
|
|
109 |
- name: Test T2w with T1w template registration |
|
|
110 |
run: | |
|
|
111 |
poetry run hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w --t1_reg_template |
|
|
112 |
|
|
|
113 |
- name: Test T2w with T1w output space |
|
|
114 |
run: | |
|
|
115 |
poetry run hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w --output_space T1w |
|
|
116 |
|
|
|
117 |
- name: Test modality T2w with myelin map |
|
|
118 |
run: | |
|
|
119 |
poetry run hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w --generate-myelin-map |
|
|
120 |
|
|
|
121 |
- name: Test modality T1w with myelin map |
|
|
122 |
run: | |
|
|
123 |
poetry run hippunfold test_data/bids_singleT2w test_out participant -np --modality T1w --generate-myelin-map |
|
|
124 |
|
|
|
125 |
- name: Test modality T1w with magdeburg atlas |
|
|
126 |
run: | |
|
|
127 |
poetry run hippunfold test_data/bids_T1w test_out participant -np --modality T1w --atlas magdeburg |
|
|
128 |
|
|
|
129 |
- name: Test modality T1w with freesurfer atlas |
|
|
130 |
run: | |
|
|
131 |
poetry run hippunfold test_data/bids_T1w test_out participant -np --modality T1w --atlas freesurfer |
|
|
132 |
|
|
|
133 |
- name: Test modality T1w with bigbrain and freesurfer atlas |
|
|
134 |
run: | |
|
|
135 |
poetry run hippunfold test_data/bids_T1w test_out participant -np --modality T1w --atlas bigbrain freesurfer |