Skip to content

Commit 26733c7

Browse files
authored
Merge branch 'nipy:master' into loadbidslayout
2 parents 5eeb072 + 5ac2f18 commit 26733c7

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

.zenodo.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,9 @@
860860
"affiliation": "MIT, HMS",
861861
"name": "Ghosh, Satrajit",
862862
"orcid": "0000-0002-5312-6729"
863+
},
864+
{
865+
"name": "Hui Qian, Tan"
863866
}
864867
],
865868
"keywords": [

nipype/interfaces/dcm2nii.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import re
55
from copy import deepcopy
66
import itertools as it
7+
import glob
78
from glob import iglob
89

910
from ..utils.filemanip import split_filename
@@ -494,4 +495,6 @@ def _list_outputs(self):
494495

495496
# https://stackoverflow.com/a/4829130
496497
def search_files(prefix, outtypes):
497-
return it.chain.from_iterable(iglob(prefix + outtype) for outtype in outtypes)
498+
return it.chain.from_iterable(
499+
iglob(glob.escape(prefix + outtype)) for outtype in outtypes
500+
)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import pytest
2+
3+
4+
from nipype.interfaces import dcm2nii
5+
6+
7+
@pytest.mark.parametrize(
8+
"fname, extension",
9+
[
10+
("output_1", ".txt"),
11+
("output_w_[]_meta_1", ".json"),
12+
("output_w_**^$?_meta_2", ".txt"),
13+
],
14+
)
15+
def test_search_files(tmp_path, fname, extension):
16+
tmp_fname = fname + extension
17+
test_file = tmp_path / tmp_fname
18+
test_file.touch()
19+
actual_files_list = dcm2nii.search_files(str(tmp_path / fname), [extension])
20+
for f in actual_files_list:
21+
assert str(test_file) == f

nipype/pipeline/plugins/legacymultiproc.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ def __init__(
143143
context=context,
144144
)
145145

146-
147146
except ImportError:
148147

149148
class NonDaemonProcess(NonDaemonMixin, mp.Process):

nipype/sphinxext/plot_workflow.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@
133133
def format_template(template, **kw):
134134
return jinja2.Template(template).render(**kw)
135135

136-
137136
except ImportError as e:
138137
missing_imports.append(str(e))
139138
try:

0 commit comments

Comments
 (0)