Skip to content

Commit ade3fd5

Browse files
authored
Merge pull request #787 from yarikoptic/bf-cast-outtypes
BF(workaround): if heuristic provided just a string and not list of types -- make it into a tuple
2 parents 0970b86 + 47b30bb commit ade3fd5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

heudiconv/convert.py

+9
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,15 @@ def convert(
562562

563563
for item in items:
564564
prefix, outtypes, item_dicoms = item
565+
if isinstance(outtypes, str): # type: ignore[unreachable]
566+
lgr.warning( # type: ignore[unreachable]
567+
"Provided output types %r of type 'str' instead "
568+
"of a tuple for prefix %r. Likely need to fix-up your heuristic. "
569+
"Meanwhile we are 'manually' converting to 'tuple'",
570+
outtypes,
571+
prefix,
572+
)
573+
outtypes = (outtypes,)
565574
prefix_dirname = op.dirname(prefix)
566575
outname_bids = prefix + ".json"
567576
bids_outfiles = []

0 commit comments

Comments
 (0)