Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STY: Manual conversions to f-strings #3241

Merged
merged 1 commit into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions fmriprep/interfaces/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,7 @@ def _generate_segment(self):
header = '\t\t<ul class="elem-desc">'
footer = '\t\t</ul>'
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{"" if n_runs == 1 else "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 @@
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>'

Check warning on line 218 in fmriprep/workflows/base.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/workflows/base.py#L218

Added line #L218 was not covered by tests
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