Skip to content

Commit

Permalink
STY: Manual conversion to f-strings
Browse files Browse the repository at this point in the history
These have not caught by pyupgrade or ruff.
  • Loading branch information
DimitriPapadopoulos committed Mar 18, 2024
1 parent d9f0a8e commit a1e5dbc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 2 additions & 3 deletions fmriprep/interfaces/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,9 @@ def _generate_segment(self):
if counts:
header = '\t\t<ul class="elem-desc">'
footer = '\t\t</ul>'
s = '' if n_runs == 1 else 's'
lines = [
'\t\t\t<li>Task: {task_id} ({n_runs:d} run{s})</li>'.format(
task_id=task_id, n_runs=n_runs, s='' if n_runs == 1 else 's'
)
f'\t\t\t<li>Task: {task_id} ({n_runs:d} run{s})</li>'
for task_id, n_runs in sorted(counts.items())
]
tasks = '\n'.join([header] + lines + [footer])
Expand Down
8 changes: 3 additions & 5 deletions fmriprep/workflows/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,10 @@ def init_single_subject_wf(subject_id: str):
anat_only = config.workflow.anat_only
# Make sure we always go through these two checks
if not anat_only and not subject_data['bold']:
task_id = config.execution.task_id
task_id = config.execution.task_id or '<all>'
raise RuntimeError(
'No BOLD images found for participant {} and task {}. '
'All workflows require BOLD images.'.format(
subject_id, task_id if task_id else '<all>'
)
f'No BOLD images found for participant {subject_id} and '
f'task {task_id}. All workflows require BOLD images.'
)

bold_runs = [
Expand Down

0 comments on commit a1e5dbc

Please sign in to comment.