Skip to content

Commit 7e3b574

Browse files
STY: Apply ruff/flynt rule FLY002
FLY002 Consider f-string instead of string join
1 parent d6d726e commit 7e3b574

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

niworkflows/interfaces/bids.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ def _run_interface(self, runtime):
604604
# Example: f"{key}-{{{key}}}" -> "task-{task}"
605605
custom_pat = '_'.join(f'{key}-{{{key}}}' for key in sorted(custom_entities))
606606
patterns = [
607-
pat.replace('_{suffix', '_'.join(('', custom_pat, '{suffix'))) for pat in patterns
607+
pat.replace('_{suffix', f'_{custom_pat}_{{suffix') for pat in patterns
608608
]
609609

610610
# Build the output path(s)
@@ -1109,7 +1109,7 @@ def _run_interface(self, runtime):
11091109
# Example: f"{key}-{{{key}}}" -> "task-{task}"
11101110
custom_pat = '_'.join(f'{key}-{{{key}}}' for key in sorted(custom_entities))
11111111
patterns = [
1112-
pat.replace('_{suffix', '_'.join(('', custom_pat, '{suffix'))) for pat in patterns
1112+
pat.replace('_{suffix', f'_{custom_pat}_{{suffix') for pat in patterns
11131113
]
11141114

11151115
# Prepare SimpleInterface outputs object

niworkflows/utils/spaces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ def __call__(self, parser, namespace, values, option_string=None):
722722
# relevant discussions:
723723
# https://github.com/nipreps/niworkflows/pull/457#discussion_r375510227
724724
# https://github.com/nipreps/niworkflows/pull/494
725-
val = ':'.join((val, 'res-native'))
725+
val = f'{val}:res-native'
726726
for sp in Reference.from_string(val):
727727
spaces.add(sp)
728728
setattr(namespace, self.dest, spaces)

0 commit comments

Comments
 (0)