Skip to content

Commit 8be5e24

Browse files
committed
sty: run black across the whole project
1 parent e18faee commit 8be5e24

File tree

4 files changed

+22
-28
lines changed

4 files changed

+22
-28
lines changed

dmriprep/workflows/dwi/eddy.py

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ def gen_eddy_textfiles(in_file, in_meta):
3636
from nipype.utils.filemanip import fname_presuffix
3737

3838
# Generate output file name
39-
out_acqparams = fname_presuffix(in_file, suffix="_acqparams.txt", use_ext=False,)
39+
out_acqparams = fname_presuffix(
40+
in_file,
41+
suffix="_acqparams.txt",
42+
use_ext=False,
43+
)
4044

4145
pe_dir = in_meta["PhaseEncodingDirection"]
4246
fsl_pe = ["0"] * 3
@@ -48,11 +52,13 @@ def gen_eddy_textfiles(in_file, in_meta):
4852
f"{' '.join(fsl_pe)} {get_trt(in_meta, in_file=in_file):0.7f}"
4953
)
5054
except ValueError:
51-
Path(out_acqparams).write_text(
52-
f"{' '.join(fsl_pe)} {0.05}"
53-
)
55+
Path(out_acqparams).write_text(f"{' '.join(fsl_pe)} {0.05}")
5456

55-
out_index = fname_presuffix(in_file, suffix="_index.txt", use_ext=False,)
57+
out_index = fname_presuffix(
58+
in_file,
59+
suffix="_index.txt",
60+
use_ext=False,
61+
)
5662
Path(out_index).write_text(f"{' '.join(['1'] * nb.load(in_file).shape[3])}")
5763
return out_acqparams, out_index
5864

@@ -81,24 +87,14 @@ def init_eddy_wf(debug=False, name="eddy_wf"):
8187

8288
inputnode = pe.Node(
8389
niu.IdentityInterface(
84-
fields=[
85-
"dwi_file",
86-
"metadata",
87-
"dwi_mask",
88-
"in_bvec",
89-
"in_bval"
90-
]
90+
fields=["dwi_file", "metadata", "dwi_mask", "in_bvec", "in_bval"]
9191
),
9292
name="inputnode",
9393
)
9494

9595
outputnode = pe.Node(
9696
niu.IdentityInterface(
97-
fields=[
98-
"out_rotated_bvecs",
99-
"eddy_ref_image",
100-
"out_eddy"
101-
]
97+
fields=["out_rotated_bvecs", "eddy_ref_image", "out_eddy"]
10298
),
10399
name="outputnode",
104100
)

docs/sphinxext/docscrape.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313

1414

1515
class Reader(object):
16-
"""A line-based string reader.
17-
18-
"""
16+
"""A line-based string reader."""
1917

2018
def __init__(self, data):
2119
"""

docs/sphinxext/github.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def ghcommit_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
155155

156156
def setup(app):
157157
"""Install the plugin.
158-
158+
159159
:param app: Sphinx application context.
160160
"""
161161
app.info("Initializing GitHub plugin")

docs/tools/apigen.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
class ApiDocWriter(object):
32-
""" Class for automatic detection and parsing of API docs
32+
"""Class for automatic detection and parsing of API docs
3333
to Sphinx-parsable reST format"""
3434

3535
# only separating first two levels
@@ -43,7 +43,7 @@ def __init__(
4343
module_skip_patterns=None,
4444
other_defines=True,
4545
):
46-
""" Initialize package for parsing
46+
"""Initialize package for parsing
4747
4848
Parameters
4949
----------
@@ -86,7 +86,7 @@ def get_package_name(self):
8686
return self._package_name
8787

8888
def set_package_name(self, package_name):
89-
""" Set package_name
89+
"""Set package_name
9090
9191
>>> docwriter = ApiDocWriter('sphinx')
9292
>>> import sphinx
@@ -116,7 +116,7 @@ def _import(self, name):
116116
return mod
117117

118118
def _get_object_name(self, line):
119-
""" Get second token in line
119+
"""Get second token in line
120120
>>> docwriter = ApiDocWriter('sphinx')
121121
>>> docwriter._get_object_name(" def func(): ")
122122
'func'
@@ -131,7 +131,7 @@ def _get_object_name(self, line):
131131
return name.rstrip(":")
132132

133133
def _uri2path(self, uri):
134-
""" Convert uri to absolute filepath
134+
"""Convert uri to absolute filepath
135135
136136
Parameters
137137
----------
@@ -329,7 +329,7 @@ def generate_api_doc(self, uri):
329329
return head, body
330330

331331
def _survives_exclude(self, matchstr, match_type):
332-
""" Returns True if *matchstr* does not match patterns
332+
"""Returns True if *matchstr* does not match patterns
333333
334334
``self.package_name`` removed from front of string if present
335335
@@ -370,7 +370,7 @@ def _survives_exclude(self, matchstr, match_type):
370370
return True
371371

372372
def discover_modules(self):
373-
""" Return module sequence discovered from ``self.package_name``
373+
"""Return module sequence discovered from ``self.package_name``
374374
375375
376376
Parameters

0 commit comments

Comments
 (0)