Skip to content

Commit 0f1aefb

Browse files
committed
STY: Clean up long comments, joins that can be f-strings
1 parent d2bc2cf commit 0f1aefb

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

fmriprep/reports/core.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,22 +79,23 @@ def generate_reports(
7979

8080
errors = []
8181
for subject_label in subject_list:
82-
83-
# The number of sessions is intentionally not based on session_list but on the total number of sessions, because
84-
# I want the final derivatives folder to be the same whether sessions were ran one at a time or all-together.
82+
# The number of sessions is intentionally not based on session_list but
83+
# on the total number of sessions, because I want the final derivatives
84+
# folder to be the same whether sessions were run one at a time or all-together.
8585
n_ses = len(config.execution.layout.get_sessions(subject=subject_label))
8686

8787
if bootstrap_file is not None:
8888
# If a config file is precised, we do not override it
8989
html_report = 'report.html'
9090
elif n_ses <= config.execution.aggr_ses_reports:
91-
# If there is only a few session for this subject, we aggregate them in a single visual report.
91+
# If there are only a few session for this subject,
92+
# we aggregate them in a single visual report.
9293
bootstrap_file = data.load('reports-spec.yml')
9394
html_report = 'report.html'
9495
else:
9596
# Beyond a threshold, we separate the anatomical report from the functional.
9697
bootstrap_file = data.load('reports-spec-anat.yml')
97-
html_report = ''.join([f"sub-{subject_label.lstrip('sub-')}", '_anat.html'])
98+
html_report = f'sub-{subject_label.lstrip("sub-")}_anat.html'
9899

99100
report_error = run_reports(
100101
output_dir,
@@ -111,7 +112,8 @@ def generate_reports(
111112
errors.append(report_error)
112113

113114
if n_ses > config.execution.aggr_ses_reports:
114-
# Beyond a certain number of sessions per subject, we separate the functional reports per session
115+
# Beyond a certain number of sessions per subject,
116+
# we separate the functional reports per session
115117
if session_list is None:
116118
all_filters = config.execution.bids_filters or {}
117119
filters = all_filters.get('bold', {})
@@ -124,9 +126,7 @@ def generate_reports(
124126

125127
for session_label in session_list:
126128
bootstrap_file = data.load('reports-spec-func.yml')
127-
html_report = ''.join(
128-
[f"sub-{subject_label.lstrip('sub-')}", f'_ses-{session_label}', '_func.html']
129-
)
129+
html_report = f'sub-{subject_label.lstrip("sub-")}_ses-{session_label}_func.html'
130130

131131
report_error = run_reports(
132132
output_dir,

0 commit comments

Comments
 (0)