Skip to content

Commit 926f0ef

Browse files
committed
sty: run ruff
1 parent abbbf6f commit 926f0ef

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

dmriprep/interfaces/reports.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ def _generate_segment(self):
150150

151151
class DiffusionSummaryInputSpec(BaseInterfaceInputSpec):
152152
pe_direction = traits.Enum(
153-
None, "i", "i-", "j", "j-", "k", "k-", desc="Phase-encoding direction detected"
153+
None, 'i', 'i-', 'j', 'j-', 'k', 'k-', desc='Phase-encoding direction detected'
154154
)
155-
shell_dist = traits.Dict(mandatory=True, desc="Shell distribution")
155+
shell_dist = traits.Dict(mandatory=True, desc='Shell distribution')
156156

157157

158158
class DiffusionSummary(SummaryInterface):
@@ -161,14 +161,11 @@ class DiffusionSummary(SummaryInterface):
161161
def _generate_segment(self):
162162
pe_direction = self.inputs.pe_direction
163163
shell_dist = self.inputs.shell_dist
164-
shell_dist_text = ", ".join(
165-
f"{shell_dist[key]} directions at b={key} s/mm<sup>2</sup>"
166-
for key in shell_dist
164+
shell_dist_text = ', '.join(
165+
f'{shell_dist[key]} directions at b={key} s/mm<sup>2</sup>' for key in shell_dist
167166
)
168167

169-
return DIFFUSION_TEMPLATE.format(
170-
pe_direction=pe_direction, shell_dist=shell_dist_text
171-
)
168+
return DIFFUSION_TEMPLATE.format(pe_direction=pe_direction, shell_dist=shell_dist_text)
172169

173170

174171
class AboutSummaryInputSpec(BaseInterfaceInputSpec):

dmriprep/interfaces/vectors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ def _run_interface(self, runtime):
121121
self._results['full_sphere'] = np.all(pole == 0.0)
122122
self._results['b0_mask'] = table.b0mask.tolist()
123123
self._results['b0_ixs'] = np.where(table.b0mask)[0].tolist()
124-
self._results["num_shells"] = len(table.count_shells)
125-
self._results["shell_dist"] = table.count_shells
126-
self._results["b0_ixs"] = np.where(table.b0mask)[0].tolist()
124+
self._results['num_shells'] = len(table.count_shells)
125+
self._results['shell_dist'] = table.count_shells
126+
self._results['b0_ixs'] = np.where(table.b0mask)[0].tolist()
127127

128128
cwd = Path(runtime.cwd).absolute()
129129
if rasb_file is None:

dmriprep/utils/vectors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
# https://www.nipreps.org/community/licensing/
2222
#
2323
"""Utilities to operate on diffusion gradients."""
24+
2425
from itertools import permutations
2526
from pathlib import Path
2627

@@ -401,7 +402,7 @@ def normalize_gradients(
401402
# Ensure rounding bvals doesn't change the number of b0s
402403
rounded_b0s = bvals == 0
403404
if not np.all(b0s == rounded_b0s):
404-
msg = f"Inconsistent b0s before ({b0s.sum()}) and after rounding ({rounded_b0s.sum()})."
405+
msg = f'Inconsistent b0s before ({b0s.sum()}) and after rounding ({rounded_b0s.sum()}).'
405406
if raise_error:
406407
raise ValueError(msg)
407408
config.loggers.cli.warning(msg)

dmriprep/workflows/dwi/outputs.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ def init_reportlets_wf(output_dir, sdc_report=False, name='reportlets_wf'):
5050
)
5151

5252
ds_report_summary = pe.Node(
53-
DerivativesDataSink(
54-
base_directory=output_dir, desc='summary', datatype='figures'
55-
),
53+
DerivativesDataSink(base_directory=output_dir, desc='summary', datatype='figures'),
5654
name='ds_report_summary',
5755
run_without_submitting=True,
5856
)

0 commit comments

Comments
 (0)