Skip to content

Commit 4c24e65

Browse files
committed
debugging bids apps refactor
1 parent c131eb6 commit 4c24e65

File tree

3 files changed

+35
-32
lines changed

3 files changed

+35
-32
lines changed

specs/australian-imaging-service/mri/human/neuro/bidsapp/fmriprep.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,6 @@ commands:
9595
type: medimage/nifti-gz-x
9696
help: "Field map - BIDS Case 3: magnitude image used for anatomical reference"
9797
path: fmap/magnitude
98-
fmap_phasediff:
99-
type: medimage/nifti-gz-x
100-
help: "Field map - BIDS Case 1: phasediff image corresponding to the phase-diff map between echo times"
101-
fmap_magnitude:
102-
type: medimage/nifti-gz-x
103-
help: "Field map - BIDS Case 3: magnitude image used for anatomical reference"
104-
path: fmap/magnitude
10598
fmap_phasediff:
10699
type: medimage/nifti-gz-x
107100
help: "Field map - BIDS Case 1: phasediff image corresponding to the phase-diff map between echo times"

specs/australian-imaging-service/mri/human/neuro/bidsapp/mriqc.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ commands:
3131
inputs:
3232
t1w:
3333
type: medimage/nifti-gz-x
34-
help: "T1-weighted anatomical scan"
34+
help: "T1-weighted anatomical MRI"
3535
path: anat/T1w
3636
t2w:
3737
type: medimage/nifti-gz-x
38-
help: "T2-weighted anatomical scan"
38+
help: "T2-weighted anatomical MRI"
3939
path: anat/T2w
40-
fMRI:
40+
bold:
4141
type: medimage/nifti-gz-x
42-
help: "functional MRI"
42+
help: "Resting-state functional MRI"
4343
path: func/task-rest_bold
4444
outputs:
4545
mriqc:

tests/test_bids_apps.py

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import itertools
23
from pydra2app.core.cli import make
34
from pydra2app.xnat import XnatApp
45
from frametree.core.utils import show_cli_trace
@@ -23,20 +24,27 @@ def test_bids_app(
2324
else:
2425
build_arg = "--build"
2526

27+
licenses = [["--license", p.stem, str(p)] for p in license_src.glob("*")]
28+
2629
result = cli_runner(
2730
make,
28-
[
29-
str(bp.spec_path),
30-
"pipelines-core-test",
31-
"--build-dir",
32-
str(build_dir),
33-
build_arg,
34-
"--for-localhost",
35-
"--use-local-packages",
36-
"--raise-errors",
37-
"--license-src",
38-
str(license_src),
39-
],
31+
list(
32+
itertools.chain(
33+
[
34+
"xnat",
35+
str(bp.spec_path),
36+
"--registry",
37+
"pipelines-core-test",
38+
"--build-dir",
39+
str(build_dir),
40+
build_arg,
41+
"--for-localhost",
42+
"--use-local-packages",
43+
"--raise-errors",
44+
],
45+
*licenses,
46+
)
47+
)
4048
)
4149

4250
assert result.exit_code == 0, show_cli_trace(result)
@@ -45,36 +53,38 @@ def test_bids_app(
4553

4654
with xnat_connect() as xlogin:
4755

56+
build_name = image_spec.name.split(".")[-1]
57+
4858
with open(
49-
build_dir / image_spec.name / "xnat_commands" / (image_spec.name + ".json")
59+
build_dir / "xnat_commands" / (build_name + ".json")
5060
) as f:
5161
xnat_command = json.load(f)
52-
xnat_command.name = xnat_command.label = image_spec.name + run_prefix
62+
xnat_command['name'] = xnat_command['label'] = image_spec.name + run_prefix
5363

5464
test_xsession = next(iter(xlogin.projects[bp.project_id].experiments.values()))
5565

5666
inputs_json = {}
5767

58-
for inpt in image_spec.command.inputs:
59-
if (bids_app_blueprint.test_data / inpt.name).exists():
68+
for inpt in image_spec.command().inputs:
69+
if (bids_app_blueprint.test_data / inpt).exists():
6070
converter_args_path = (
61-
bids_app_blueprint.test_data / inpt.name / "converter.json"
71+
bids_app_blueprint.test_data / inpt / "converter.json"
6272
)
6373
converter_args = ""
6474
if converter_args_path.exists():
6575
with open(converter_args_path) as f:
6676
dct = json.load(f)
6777
for name, val in dct.items():
6878
converter_args += f" converter.{name}={val}"
69-
inputs_json[inpt.name] = inpt.name + converter_args
79+
inputs_json[inpt] = inpt + converter_args
7080
else:
71-
inputs_json[inpt.name] = ""
81+
inputs_json[inpt] = ""
7282

7383
for pname, pval in bp.parameters.items():
7484
inputs_json[pname] = pval
7585

76-
inputs_json["Arcana_flags"] = (
77-
"--worker serial "
86+
inputs_json["pydra_flags"] = (
87+
"--worker debug "
7888
"--work /work " # NB: work dir moved inside container due to file-locking issue on some mounted volumes (see https://github.com/tox-dev/py-filelock/issues/147)
7989
"--dataset-name default "
8090
"--loglevel debug "

0 commit comments

Comments
 (0)