Skip to content

Commit

Permalink
Merge pull request #787 from yarikoptic/bf-cast-outtypes
Browse files Browse the repository at this point in the history
BF(workaround): if heuristic provided just a string and not list of types -- make it into a tuple
  • Loading branch information
yarikoptic authored Oct 2, 2024
2 parents 0970b86 + 47b30bb commit ade3fd5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions heudiconv/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,15 @@ def convert(

for item in items:
prefix, outtypes, item_dicoms = item
if isinstance(outtypes, str): # type: ignore[unreachable]
lgr.warning( # type: ignore[unreachable]
"Provided output types %r of type 'str' instead "
"of a tuple for prefix %r. Likely need to fix-up your heuristic. "
"Meanwhile we are 'manually' converting to 'tuple'",
outtypes,
prefix,
)
outtypes = (outtypes,)
prefix_dirname = op.dirname(prefix)
outname_bids = prefix + ".json"
bids_outfiles = []
Expand Down

0 comments on commit ade3fd5

Please sign in to comment.