Skip to content

Commit 75460f5

Browse files
committed
ENH: reproin - log applied substitutions
Example of the log now heudiconv/heuristics/test_reproin.py::test_fix_dbic_protocol INFO: Considering study (0e4497bdaae2608324a85be1f54f60ed) specific substitutions INFO: field1: '02-anat-scout_run+_MPR_sag' -> '02-anat-THESCOUT_MPR_sag' INFO: Considering global substitutions INFO: field1: '02-anat-THESCOUT_MPR_sag' -> '02-anat-scout_MPR_sag' INFO: Considering study (0e4497bdaae2608324a85be1f54f60ed) specific substitutions INFO: field2: '11-func_run-life2_acq-2mm692' -> '11-func_run+_task-life_acq-2mm692' INFO: Considering global substitutions
1 parent 2fc27a4 commit 75460f5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

heudiconv/heuristics/reproin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,12 @@ def fix_dbic_protocol(seqinfo):
412412
fixed_kwargs = dict()
413413
# need to replace both protocol_name series_description
414414
for key in series_spec_fields:
415-
value = getattr(s, key)
415+
oldvalue = value = getattr(s, key)
416416
# replace all I need to replace
417417
for substring, replacement in substitutions:
418418
value = re.sub(substring, replacement, value)
419+
if oldvalue != value:
420+
lgr.info(" %s: %r -> %r", key, oldvalue, value)
419421
fixed_kwargs[key] = value
420422
# namedtuples are immutable
421423
seqinfo[i] = s._replace(**fixed_kwargs)

0 commit comments

Comments
 (0)