Skip to content

Commit 9730486

Browse files
committed
ENH: just do all replacements in "one" line and avoid unneeded 2nd str()
1 parent 4c36fb4 commit 9730486

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

heudiconv/heuristics/reproin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,8 +888,9 @@ def split2(s):
888888

889889
# sanitize values, which must not have _ and - is undesirable ATM as well
890890
# TODO: BIDSv2.0 -- allows "-" so replace with it instead
891-
value = str(value).replace('_', 'X').replace('-', 'X')
892-
value = str(value).replace('(', '{').replace(')', '}') # for Philips
891+
value = str(value) \
892+
.replace('_', 'X').replace('-', 'X') \
893+
.replace('(', '{').replace(')', '}') # for Philips
893894

894895
if key in ['ses', 'run', 'task', 'acq']:
895896
# those we care about explicitly

0 commit comments

Comments
 (0)