Skip to content

Commit fdea77c

Browse files
authored
Merge pull request #419 from dbic/bf-reproin
BF: case seqinfos into a list so entries could be modified if necessary
2 parents 756fd80 + 10715fa commit fdea77c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

heudiconv/heuristics/reproin.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,16 @@ def get_unique(seqinfos, attr):
741741
# hits, or may be we could just somehow demarkate that it will be multisession
742742
# one and so then later value parsed (again) in infotodict would be used???
743743
def infotoids(seqinfos, outdir):
744+
# In python 3.7.5 we would obtain odict_keys() object which would be
745+
# immutable, and we would not be able to perform any substitutions if
746+
# needed. So let's make it into a regular list
747+
if isinstance(seqinfos, dict) or hasattr(seqinfos, 'keys'):
748+
# just some checks for a paranoid Yarik
749+
raise TypeError(
750+
"Expected list-like structure here, not associative array. Got %s"
751+
% type(seqinfos)
752+
)
753+
seqinfos = list(seqinfos)
744754
# decide on subjid and session based on patient_id
745755
lgr.info("Processing sequence infos to deduce study/session")
746756
study_description = get_study_description(seqinfos)

0 commit comments

Comments
 (0)