-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
145 lines (128 loc) · 3.83 KB
/
pyproject.toml
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
141
142
143
144
145
[tool.poetry]
name = "scattr"
version = "0.3.4-pre.1"
description = "[Snakebids app] Structural connectivity between targeted regions"
authors = [
"Jason Kai <[email protected]>",
"Tristan Kuehn",
"Ali R. Khan",
"Roy A.M. Haast",
"Jonathan C. Lau",
]
readme = "README.md"
documentation = "https://scattr.readthedocs.io"
packages = [{ include = "scattr" }]
[tool.poetry.dependencies]
python = ">=3.8, <3.12"
snakebids = "^0.10.2"
labelmerge = "^0.4.7"
matplotlib = "^3.7.1"
nibabel = "^3.2.2"
nilearn = "^0.10.0"
niworkflows = "^1.7.9"
numpy = "^1.22.3"
pygments = "^2.15.1"
scipy = "^1.8.0"
# Required constraint for compatability with snakebids
pulp = "<2.8.0"
[tool.poetry.group.dev.dependencies]
pytest-console-scripts = "1.2"
pytest = "^7.0.1"
poethepoet = "^0.13.1"
pre-commit = "^2.17.0"
snakefmt = "^0.6.1"
yamlfix = "^1.1.0"
ruff = "^0.1.14"
[tool.poetry.scripts]
scattr = 'scattr.run:main'
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.poe.tasks]
setup = "pre-commit install"
ruff-lint = "ruff check --fix scattr"
ruff-lint-check = "ruff check scattr"
ruff-format = "ruff format ."
snakefmt = "snakefmt scattr"
snakefmt-check = "snakefmt --check scattr"
quality = ["yamlfix", "ruff-lint", "ruff-format", "snakefmt"]
quality-check = ["yamlfix-check", "ruff-lint-check", "snakefmt-check"]
test = [
"test_base",
"test_freesurfer",
"test_responsemean",
"test_dwi",
"test_labelmerge",
"test_skip_labelmerge",
"test_sessions",
]
[tool.poe.tasks.test_base]
shell = """
python ./scattr/run.py ./test/data/bids ./test/data/derivatives/ participant \
--fs-license ./test/.fs_license -np --force-output
"""
[tool.poe.tasks.test_freesurfer]
shell = """
python ./scattr/run.py ./test/data/bids test/data/derivatives/ participant \
--freesurfer_dir ./test/data/derivatives/freesurfer \
--fs-license ./test/.fs_license -np --force-output
"""
[tool.poe.tasks.test_responsemean]
shell = """
python ./scattr/run.py ./test/data/bids test/data/derivatives/ participant \
--responsemean_dir ./test/data/derivatives/mrtrix/avg \
--fs-license ./test/.fs_license -np --force-output
"""
[tool.poe.tasks.test_dwi]
shell = """
python ./scattr/run.py ./test/data/bids_nodwi test/data/derivatives/ \
participant --dwi_dir ./test/data/derivatives/prepdwi \
--fs-license ./test/.fs_license -np --force-output
"""
[tool.poe.tasks.test_snakedwi]
shell = """
python ./scattr/run.py ./test/data/bids_nodwi test/data/derivatives/ \
participant --dwi_dir ./test/data/derivatives/snakedwi \
--fs-license ./test/.fs_license -np --force-output
"""
[tool.poe.tasks.test_labelmerge]
shell = """
python ./scattr/run.py ./test/data/bids test/data/derivatives/ participant \
--labelmerge_base_dir ./base_dir \
--labelmerge_overlay_dir ./overlay_dir \
--skip_brainstem --skip_thal_seg \
--fs-license ./test/.fs_license -np --force-output
"""
[tool.poe.tasks.test_skip_labelmerge]
shell = """
python ./scattr/run.py ./test/data/bids test/data/derivatives/ participant \
--skip_labelmerge --skip_brainstem --skip_thal_seg \
--fs-license ./test/.fs_license -np --force-output
"""
[tool.poe.tasks.test_sessions]
shell = """
python ./scattr/run.py ./test/data/bids_sessions \
test/data/derivatives_sessions/ participant \
--fs-license ./test.fs_license -np --force-output
"""
[tool.poe.tasks.yamlfix]
shell = """
find . -type f \\( \
-iname \\*.yaml -o -iname \\*.yml ! -iname snakemake* \
! -iname snakebids* \
\\) -exec yamlfix {} \\;
"""
[tool.poe.tasks.yamlfix-check]
shell = """
find . -type f \\( \
-iname \\*.yaml -o -iname \\*.yml ! -iname snakemake* \
! -iname snakebids* \
\\) -exec yamlfix --check {} \\;
"""
[tool.ruff]
select = ["E", "W", "N", "RUF", "I", "UP"]
line-length = 79
builtins = ["snakemake"]
[tool.snakefmt]
line_length = 79
include = '\.smk$|^Snakefile'