Skip to content

Commit 661e0ca

Browse files
committed
fix conflicts
2 parents 7defae0 + 9511484 commit 661e0ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+422
-544
lines changed

pydra/tasks/fsl/model/cluster.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ def Cluster_output(inputs):
88
from pydra.engine.helpers_file import split_filename
99

1010
in_file = inputs.in_file
11-
11+
1212
if in_file not in [None, attr.NOTHING]:
1313
pth, fname, ext = split_filename(in_file)
1414
return f"{fname}_localmax.txt"
1515
else:
16-
raise Exception(
17-
f"this function should be run only for out_localmax_txt_file not {name}"
18-
)
16+
raise Exception(f"this function should be run only for out_localmax_txt_file not {name}")
1917

2018

2119
input_fields = [
@@ -67,7 +65,6 @@ def Cluster_output(inputs):
6765
"help_string": "output of local maxima volume",
6866
"argstr": "--olmaxim={out_localmax_vol_file}",
6967
"output_file_template": "{in_file}_localmax",
70-
7168
},
7269
),
7370
(
@@ -76,7 +73,7 @@ def Cluster_output(inputs):
7673
{
7774
"help_string": "filename for output of size image",
7875
"argstr": "--osize={out_size_file}",
79-
"output_file_template": "{in_file}_size"
76+
"output_file_template": "{in_file}_size",
8077
},
8178
),
8279
(
@@ -85,7 +82,7 @@ def Cluster_output(inputs):
8582
{
8683
"help_string": "filename for output of max image",
8784
"argstr": "--omax={out_max_file}",
88-
"output_file_template": "{in_file}_max"
85+
"output_file_template": "{in_file}_max",
8986
},
9087
),
9188
(
@@ -94,7 +91,7 @@ def Cluster_output(inputs):
9491
{
9592
"help_string": "filename for output of mean image",
9693
"argstr": "--omean={out_mean_file}",
97-
"output_file_template": "{in_file}_mean"
94+
"output_file_template": "{in_file}_mean",
9895
},
9996
),
10097
(
@@ -103,7 +100,7 @@ def Cluster_output(inputs):
103100
{
104101
"help_string": "filename for image output of log pvals",
105102
"argstr": "--opvals={out_pval_file}",
106-
"output_file_template": "{in_file}_pval"
103+
"output_file_template": "{in_file}_pval",
107104
},
108105
),
109106
(
@@ -214,13 +211,9 @@ def Cluster_output(inputs):
214211
},
215212
),
216213
]
217-
Cluster_input_spec = specs.SpecInfo(
218-
name="Input", fields=input_fields, bases=(specs.ShellSpec,)
219-
)
214+
Cluster_input_spec = specs.SpecInfo(name="Input", fields=input_fields, bases=(specs.ShellSpec,))
220215

221-
output_fields = [
222-
223-
]
216+
output_fields = []
224217
Cluster_output_spec = specs.SpecInfo(
225218
name="Output", fields=output_fields, bases=(specs.ShellOutSpec,)
226219
)
@@ -240,4 +233,4 @@ class Cluster(ShellCommandTask):
240233

241234
input_spec = Cluster_input_spec
242235
output_spec = Cluster_output_spec
243-
executable = "cluster"
236+
executable = "cluster"

pydra/tasks/fsl/model/feat.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,12 @@ def FEAT_output(fsf_file):
3939
},
4040
)
4141
]
42-
FEAT_input_spec = specs.SpecInfo(
43-
name="Input", fields=input_fields, bases=(specs.ShellSpec,)
44-
)
42+
FEAT_input_spec = specs.SpecInfo(name="Input", fields=input_fields, bases=(specs.ShellSpec,))
4543

4644
output_fields = [
4745
("feat_dir", specs.Directory, {"requires": ["fsf_file"], "callable": FEAT_output})
4846
]
49-
FEAT_output_spec = specs.SpecInfo(
50-
name="Output", fields=output_fields, bases=(specs.ShellOutSpec,)
51-
)
47+
FEAT_output_spec = specs.SpecInfo(name="Output", fields=output_fields, bases=(specs.ShellOutSpec,))
5248

5349

5450
class FEAT(ShellCommandTask):
@@ -63,4 +59,4 @@ class FEAT(ShellCommandTask):
6359

6460
input_spec = FEAT_input_spec
6561
output_spec = FEAT_output_spec
66-
executable = "feat"
62+
executable = "feat"

pydra/tasks/fsl/model/featmodel.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ def FEATModel_output(field, fsf_file):
6464
},
6565
),
6666
]
67-
FEATModel_input_spec = specs.SpecInfo(
68-
name="Input", fields=input_fields, bases=(specs.ShellSpec,)
69-
)
67+
FEATModel_input_spec = specs.SpecInfo(name="Input", fields=input_fields, bases=(specs.ShellSpec,))
7068

7169
output_fields = [
7270
(
@@ -118,4 +116,4 @@ def FEATModel_output(field, fsf_file):
118116
class FEATModel(ShellCommandTask):
119117
input_spec = FEATModel_input_spec
120118
output_spec = FEATModel_output_spec
121-
executable = "feat_model"
119+
executable = "feat_model"

pydra/tasks/fsl/model/filmgls.py

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from pydra import ShellCommandTask
33
import typing as ty
44

5+
56
def FILMGLS_output(field, inputs):
67
import os, attr
78

@@ -39,7 +40,7 @@ def _get_numcons(inputs):
3940
return numtcons, numfcons
4041

4142
name = field.name
42-
pth = inputs.results_dir
43+
pth = inputs.results_dir
4344
if name == "results_dir":
4445
return pth
4546
elif name == "param_estimates":
@@ -57,7 +58,7 @@ def _get_numcons(inputs):
5758
return os.path.join(pth, "threshac1.nii.gz")
5859
elif name == "logfile":
5960
return os.path.join(pth, "logfile")
60-
61+
6162
numtcons, numfcons = _get_numcons(inputs)
6263
base_contrast = 1
6364
copes = []
@@ -90,9 +91,7 @@ def _get_numcons(inputs):
9091
return zfstats
9192

9293

93-
9494
input_fields = [
95-
9695
(
9796
"in_file",
9897
specs.File,
@@ -263,15 +262,10 @@ def _get_numcons(inputs):
263262
"results_dir",
264263
str,
265264
"results",
266-
{
267-
"help_string": "directory to store results in",
268-
"argstr": "--rn={results_dir}"
269-
},
265+
{"help_string": "directory to store results in", "argstr": "--rn={results_dir}"},
270266
),
271267
]
272-
FILMGLS_input_spec = specs.SpecInfo(
273-
name="Input", fields=input_fields, bases=(specs.ShellSpec,)
274-
)
268+
FILMGLS_input_spec = specs.SpecInfo(name="Input", fields=input_fields, bases=(specs.ShellSpec,))
275269

276270
output_fields = [
277271
(
@@ -327,32 +321,56 @@ def _get_numcons(inputs):
327321
(
328322
"copes",
329323
specs.MultiOutputFile,
330-
{"help_string": "Contrast estimates for each contrast", "requires": ["tcon_file"], "callable": FILMGLS_output},
324+
{
325+
"help_string": "Contrast estimates for each contrast",
326+
"requires": ["tcon_file"],
327+
"callable": FILMGLS_output,
328+
},
331329
),
332330
(
333331
"varcopes",
334332
specs.MultiOutputFile,
335-
{"help_string": "Variance estimates for each contrast", "requires": ["tcon_file"], "callable": FILMGLS_output},
333+
{
334+
"help_string": "Variance estimates for each contrast",
335+
"requires": ["tcon_file"],
336+
"callable": FILMGLS_output,
337+
},
336338
),
337339
(
338340
"zstats",
339341
specs.MultiOutputFile,
340-
{"help_string": "z-stat file for each contrast", "requires": ["tcon_file"], "callable": FILMGLS_output},
342+
{
343+
"help_string": "z-stat file for each contrast",
344+
"requires": ["tcon_file"],
345+
"callable": FILMGLS_output,
346+
},
341347
),
342348
(
343349
"tstats",
344350
specs.MultiOutputFile,
345-
{"help_string": "t-stat file for each contrast","requires": ["tcon_file"], "callable": FILMGLS_output},
351+
{
352+
"help_string": "t-stat file for each contrast",
353+
"requires": ["tcon_file"],
354+
"callable": FILMGLS_output,
355+
},
346356
),
347357
(
348358
"fstats",
349359
specs.MultiOutputFile,
350-
{"help_string": "f-stat file for each contrast", "requires": ["fcon_file"],"callable": FILMGLS_output},
360+
{
361+
"help_string": "f-stat file for each contrast",
362+
"requires": ["fcon_file"],
363+
"callable": FILMGLS_output,
364+
},
351365
),
352366
(
353367
"zfstats",
354368
specs.MultiOutputFile,
355-
{"help_string": "z-stat file for each F contrast", "requires": ["fcon_file"], "callable": FILMGLS_output},
369+
{
370+
"help_string": "z-stat file for each F contrast",
371+
"requires": ["fcon_file"],
372+
"callable": FILMGLS_output,
373+
},
356374
),
357375
]
358376
FILMGLS_output_spec = specs.SpecInfo(
@@ -375,4 +393,4 @@ class FILMGLS(ShellCommandTask):
375393

376394
input_spec = FILMGLS_input_spec
377395
output_spec = FILMGLS_output_spec
378-
executable = "film_gls"
396+
executable = "film_gls"

pydra/tasks/fsl/model/flameo.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def atoi(text):
1616

1717
def natural_keys(text):
1818
import re
19-
19+
2020
if isinstance(text, tuple):
2121
text = text[0]
2222
return [atoi(c) for c in re.split(r"(\d+)", text)]
@@ -25,7 +25,7 @@ def natural_keys(text):
2525

2626
pth = inputs.log_dir
2727
name = field.name
28-
28+
2929
if name == "pes":
3030
pes = human_order_sorted(glob.glob(os.path.join(pth, "pe[0-9]*.*")))
3131
if len(pes) >= 1:
@@ -51,9 +51,7 @@ def natural_keys(text):
5151
if len(tstats) >= 1:
5252
return tstats
5353
elif name == "mrefvars":
54-
mrefs = human_order_sorted(
55-
glob.glob(os.path.join(pth, "mean_random_effects_var[0-9]*.*"))
56-
)
54+
mrefs = human_order_sorted(glob.glob(os.path.join(pth, "mean_random_effects_var[0-9]*.*")))
5755
if len(mrefs) >= 1:
5856
return mrefs
5957
elif name == "tdof":
@@ -211,9 +209,7 @@ def natural_keys(text):
211209
),
212210
("log_dir", ty.Any, "stats", {"help_string": "", "argstr": "--ld={log_dir}"}),
213211
]
214-
FLAMEO_input_spec = specs.SpecInfo(
215-
name="Input", fields=input_fields, bases=(specs.ShellSpec,)
216-
)
212+
FLAMEO_input_spec = specs.SpecInfo(name="Input", fields=input_fields, bases=(specs.ShellSpec,))
217213

218214
output_fields = [
219215
(
@@ -337,4 +333,4 @@ class FLAMEO(ShellCommandTask):
337333

338334
input_spec = FLAMEO_input_spec
339335
output_spec = FLAMEO_output_spec
340-
executable = "flameo"
336+
executable = "flameo"

pydra/tasks/fsl/model/glm.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,10 @@
172172
},
173173
),
174174
]
175-
GLM_input_spec = specs.SpecInfo(
176-
name="Input", fields=input_fields, bases=(specs.ShellSpec,)
177-
)
175+
GLM_input_spec = specs.SpecInfo(name="Input", fields=input_fields, bases=(specs.ShellSpec,))
178176

179177
output_fields = []
180-
GLM_output_spec = specs.SpecInfo(
181-
name="Output", fields=output_fields, bases=(specs.ShellOutSpec,)
182-
)
178+
GLM_output_spec = specs.SpecInfo(name="Output", fields=output_fields, bases=(specs.ShellOutSpec,))
183179

184180

185181
class GLM(ShellCommandTask):
@@ -195,4 +191,4 @@ class GLM(ShellCommandTask):
195191

196192
input_spec = GLM_input_spec
197193
output_spec = GLM_output_spec
198-
executable = "fsl_glm"
194+
executable = "fsl_glm"

pydra/tasks/fsl/model/melodic.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,7 @@ def MELODIC_output(field, inputs):
320320
},
321321
),
322322
]
323-
MELODIC_input_spec = specs.SpecInfo(
324-
name="Input", fields=input_fields, bases=(specs.ShellSpec,)
325-
)
323+
MELODIC_input_spec = specs.SpecInfo(name="Input", fields=input_fields, bases=(specs.ShellSpec,))
326324

327325
output_fields = [
328326
("out_dir", specs.Directory, {"callable": MELODIC_output}),
@@ -355,4 +353,4 @@ class MELODIC(ShellCommandTask):
355353

356354
input_spec = MELODIC_input_spec
357355
output_spec = MELODIC_output_spec
358-
executable = "melodic"
356+
executable = "melodic"

pydra/tasks/fsl/model/tests/test_run_cluster.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
from ..cluster import Cluster
44

55

6-
@pytest.mark.xfail(
7-
"FSLDIR" not in os.environ, reason="no FSL found", raises=FileNotFoundError
8-
)
6+
@pytest.mark.xfail("FSLDIR" not in os.environ, reason="no FSL found", raises=FileNotFoundError)
97
@pytest.mark.parametrize(
108
"inputs, outputs",
119
[
@@ -51,9 +49,7 @@ def test_Cluster(test_data, inputs, outputs):
5149
except:
5250
pass
5351
task = Cluster(**inputs)
54-
assert set(task.generated_output_names) == set(
55-
["return_code", "stdout", "stderr"] + outputs
56-
)
52+
assert set(task.generated_output_names) == set(["return_code", "stdout", "stderr"] + outputs)
5753
res = task()
5854
print("RESULT: ", res)
5955
for out_nm in outputs:

pydra/tasks/fsl/model/tests/test_run_feat.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
from ..feat import FEAT
44

55

6-
@pytest.mark.xfail(
7-
"FSLDIR" not in os.environ, reason="no FSL found", raises=FileNotFoundError
8-
)
6+
@pytest.mark.xfail("FSLDIR" not in os.environ, reason="no FSL found", raises=FileNotFoundError)
97
@pytest.mark.parametrize("inputs, outputs", [])
108
def test_FEAT(test_data, inputs, outputs):
119
if inputs is None:
@@ -33,9 +31,7 @@ def test_FEAT(test_data, inputs, outputs):
3331
except:
3432
pass
3533
task = FEAT(**inputs)
36-
assert set(task.generated_output_names) == set(
37-
["return_code", "stdout", "stderr"] + outputs
38-
)
34+
assert set(task.generated_output_names) == set(["return_code", "stdout", "stderr"] + outputs)
3935
res = task()
4036
print("RESULT: ", res)
4137
for out_nm in outputs:

0 commit comments

Comments
 (0)