Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mgxd committed Jan 27, 2020
1 parent 58f7315 commit 5a65c7f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions smriprep/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ def build_workflow(opts, retval):
spaces = Spaces(output=opts.output_spaces)
target_spaces = spaces.unique()
if not target_spaces:
# no output spaces have been set - should this blow up?
# Set the default template to 'MNI152NLin2009c'
spaces.add_space('MNI152NLin2009cAsym', output=False)

Expand Down
9 changes: 4 additions & 5 deletions smriprep/cli/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Test the output-spaces parser."""
from collections import OrderedDict
import pytest
from .. import utils as u

Expand All @@ -20,9 +19,9 @@ def test_output_spaces(monkeypatch):
[('MNI152NLin2009cAsym', {'native': True})]
assert u.output_space('MNI152NLin2009cAsym:res-2') == \
[('MNI152NLin2009cAsym', {'res': '2'})]
assert u.output_space('MNI152:res-1:res-2') == \
[('MNI152', {'res': '1'}), ('MNI152', {'res': '2'})]
assert u.output_space('MNIInfant:res-2:cohort-1') == \
assert u.output_space('MNI152NLin6Asym:res-1:res-2') == \
[('MNI152NLin6Asym', {'res': '1'}), ('MNI152NLin6Asym', {'res': '2'})]
assert u.output_space('MNIInfant:res-2,cohort-1') == \
[('MNIInfant', {'res': '2', 'cohort': '1'})]

with pytest.raises(ValueError):
Expand Down Expand Up @@ -52,7 +51,7 @@ def test_template_parser(monkeypatch):

u.ParseTemplates.set_nonstandard_spaces('func')
assert u._template(['MNI152NLin2009cAsym:res-2', 'func']) == \
[('MNI152NLin2009cAsym', {'res': '2'}), ('func', {})]
[('MNI152NLin2009cAsym', {'res': '2'}), ('func', {})]

u.ParseTemplates.set_nonstandard_spaces(['func', 'fsnative'])
assert u._template(['MNI152NLin2009cAsym:res-2', 'func', 'fsnative']) == \
Expand Down
2 changes: 1 addition & 1 deletion smriprep/workflows/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def init_single_subject_wf(
bids_info = pe.Node(BIDSInfo(bids_dir=layout.root), name='bids_info',
run_without_submitting=True)

summary = pe.Node(SubjectSummary(output_spaces=list(spaces.unique('output'))),
summary = pe.Node(SubjectSummary(output_spaces=list(spaces.unique())),
name='summary', run_without_submitting=True)

about = pe.Node(AboutSummary(version=__version__,
Expand Down

0 comments on commit 5a65c7f

Please sign in to comment.