Skip to content

Commit 9f69192

Browse files
STY: Manual conversions to f-strings (#3241)
These have not caught by pyupgrade or ruff.
1 parent e9a5bfc commit 9f69192

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

fmriprep/interfaces/reports.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,7 @@ def _generate_segment(self):
170170
header = '\t\t<ul class="elem-desc">'
171171
footer = '\t\t</ul>'
172172
lines = [
173-
'\t\t\t<li>Task: {task_id} ({n_runs:d} run{s})</li>'.format(
174-
task_id=task_id, n_runs=n_runs, s='' if n_runs == 1 else 's'
175-
)
173+
f'\t\t\t<li>Task: {task_id} ({n_runs:d} run{"" if n_runs == 1 else "s"})</li>'
176174
for task_id, n_runs in sorted(counts.items())
177175
]
178176
tasks = '\n'.join([header] + lines + [footer])

fmriprep/workflows/base.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,10 @@ def init_single_subject_wf(subject_id: str):
215215
anat_only = config.workflow.anat_only
216216
# Make sure we always go through these two checks
217217
if not anat_only and not subject_data['bold']:
218-
task_id = config.execution.task_id
218+
task_id = config.execution.task_id or '<all>'
219219
raise RuntimeError(
220-
'No BOLD images found for participant {} and task {}. '
221-
'All workflows require BOLD images.'.format(
222-
subject_id, task_id if task_id else '<all>'
223-
)
220+
f'No BOLD images found for participant {subject_id} and '
221+
f'task {task_id}. All workflows require BOLD images.'
224222
)
225223

226224
bold_runs = [

0 commit comments

Comments
 (0)