Skip to content

Commit 97e7d20

Browse files
authored
Merge pull request #917 from DimitriPapadopoulos/FLY
STY: Apply ruff/flynt rule FLY002
2 parents a94ebbd + 3783ce7 commit 97e7d20

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

niworkflows/interfaces/bids.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -602,9 +602,7 @@ def _run_interface(self, runtime):
602602
if custom_entities:
603603
# Example: f"{key}-{{{key}}}" -> "task-{task}"
604604
custom_pat = '_'.join(f'{key}-{{{key}}}' for key in sorted(custom_entities))
605-
patterns = [
606-
pat.replace('_{suffix', '_'.join(('', custom_pat, '{suffix'))) for pat in patterns
607-
]
605+
patterns = [pat.replace('_{suffix', f'_{custom_pat}_{{suffix') for pat in patterns]
608606

609607
# Build the output path(s)
610608
dest_files = build_path(out_entities, path_patterns=patterns)
@@ -1107,9 +1105,7 @@ def _run_interface(self, runtime):
11071105
if custom_entities:
11081106
# Example: f"{key}-{{{key}}}" -> "task-{task}"
11091107
custom_pat = '_'.join(f'{key}-{{{key}}}' for key in sorted(custom_entities))
1110-
patterns = [
1111-
pat.replace('_{suffix', '_'.join(('', custom_pat, '{suffix'))) for pat in patterns
1112-
]
1108+
patterns = [pat.replace('_{suffix', f'_{custom_pat}_{{suffix') for pat in patterns]
11131109

11141110
# Prepare SimpleInterface outputs object
11151111
self._results['out_file'] = []

niworkflows/utils/spaces.py

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

0 commit comments

Comments
 (0)