Skip to content

Commit 4a6a7d9

Browse files
committed
STY: black
1 parent fb1662a commit 4a6a7d9

File tree

5 files changed

+34
-24
lines changed

5 files changed

+34
-24
lines changed

doc/devel/matlab_example1.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
from nipype.interfaces.matlab import MatlabCommand
2-
from nipype.interfaces.base import TraitedSpec, \
3-
BaseInterface, BaseInterfaceInputSpec, File
2+
from nipype.interfaces.base import (
3+
TraitedSpec,
4+
BaseInterface,
5+
BaseInterfaceInputSpec,
6+
File,
7+
)
48
import os
59
from string import Template
610

@@ -19,14 +23,15 @@ class ConmapTxt2Mat(BaseInterface):
1923
output_spec = ConmapTxt2MatOutputSpec
2024

2125
def _run_interface(self, runtime):
22-
d = dict(in_file=self.inputs.in_file,
23-
out_file=self.inputs.out_file)
26+
d = dict(in_file=self.inputs.in_file, out_file=self.inputs.out_file)
2427
# This is your MATLAB code template
25-
script = Template("""in_file = '$in_file';
28+
script = Template(
29+
"""in_file = '$in_file';
2630
out_file = '$out_file';
2731
ConmapTxt2Mat(in_file, out_file);
2832
exit;
29-
""").substitute(d)
33+
"""
34+
).substitute(d)
3035

3136
# mfile = True will create an .m file with your script and executed.
3237
# Alternatively

doc/devel/matlab_example2.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55

66
class HelloWorldInputSpec(MatlabInputSpec):
7-
name = traits.Str(mandatory=True,
8-
desc='Name of person to say hello to')
7+
name = traits.Str(mandatory=True, desc='Name of person to say hello to')
98

109

1110
class HelloWorldOutputSpec(TraitedSpec):
@@ -29,6 +28,7 @@ class HelloWorld(MatlabCommand):
2928
>>> out = hello.run()
3029
>>> print out.outputs.matlab_output
3130
"""
31+
3232
input_spec = HelloWorldInputSpec
3333
output_spec = HelloWorldOutputSpec
3434

@@ -37,7 +37,9 @@ def _my_script(self):
3737
script = """
3838
disp('Hello %s Python')
3939
two = 1 + 1
40-
""" % (self.inputs.name)
40+
""" % (
41+
self.inputs.name
42+
)
4143
return script
4244

4345
def run(self, **inputs):

tools/checkspecs.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
# Functions and classes
1515
class InterfaceChecker(object):
16-
"""Class for checking all interface specifications
17-
"""
16+
"""Class for checking all interface specifications"""
1817

1918
def __init__(
2019
self,
@@ -23,7 +22,7 @@ def __init__(
2322
module_skip_patterns=None,
2423
class_skip_patterns=None,
2524
):
26-
r""" Initialize package for parsing
25+
r"""Initialize package for parsing
2726
2827
Parameters
2928
----------
@@ -113,14 +112,14 @@ def _uri2path(self, uri):
113112
return path
114113

115114
def _path2uri(self, dirpath):
116-
""" Convert directory path to uri """
115+
"""Convert directory path to uri"""
117116
relpath = dirpath.replace(self.root_path, self.package_name)
118117
if relpath.startswith(os.path.sep):
119118
relpath = relpath[1:]
120119
return relpath.replace(os.path.sep, ".")
121120

122121
def _parse_module(self, uri):
123-
""" Parse module defined in *uri* """
122+
"""Parse module defined in *uri*"""
124123
filename = self._uri2path(uri)
125124
if filename is None:
126125
# nothing that we could handle here.
@@ -131,7 +130,7 @@ def _parse_module(self, uri):
131130
return functions, classes
132131

133132
def _parse_lines(self, linesource, module):
134-
""" Parse lines of text for functions and classes """
133+
"""Parse lines of text for functions and classes"""
135134
functions = []
136135
classes = []
137136
for line in linesource:
@@ -387,7 +386,7 @@ def test_specs(self, uri):
387386
return bad_specs
388387

389388
def _survives_exclude(self, matchstr, match_type):
390-
""" Returns True if *matchstr* does not match patterns
389+
"""Returns True if *matchstr* does not match patterns
391390
392391
``self.package_name`` removed from front of string if present
393392
@@ -429,7 +428,7 @@ def _survives_exclude(self, matchstr, match_type):
429428
return True
430429

431430
def discover_modules(self):
432-
""" Return module sequence discovered from ``self.package_name``
431+
"""Return module sequence discovered from ``self.package_name``
433432
434433
435434
Parameters

tools/gitwash_dumper.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ def cp_files(in_path, globs, out_path):
5050

5151

5252
def filename_search_replace(sr_pairs, filename, backup=False):
53-
""" Search and replace for expressions in files
54-
55-
"""
53+
"""Search and replace for expressions in files"""
5654
in_txt = open(filename, "rt").read(-1)
5755
out_txt = in_txt[:]
5856
for in_exp, out_exp in sr_pairs:
@@ -94,7 +92,7 @@ def make_link_targets(
9492
url=None,
9593
ml_url=None,
9694
):
97-
""" Check and make link targets
95+
"""Check and make link targets
9896
9997
If url is None or ml_url is None, check if there are links present for
10098
these in `known_link_fname`. If not, raise error. The check is:

tools/run_examples.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44

55

66
if __name__ == "__main__":
7-
print(dedent("""Nipype examples have been moved to niflow-nipype1-examples.
7+
print(
8+
dedent(
9+
"""Nipype examples have been moved to niflow-nipype1-examples.
810
9-
Install with: pip install niflow-nipype1-examples"""))
11+
Install with: pip install niflow-nipype1-examples"""
12+
)
13+
)
1014
if sys.argv[1:]:
11-
print("Run this command with: niflow-nipype1-examples " + " ".join(sys.argv[1:]))
15+
print(
16+
"Run this command with: niflow-nipype1-examples " + " ".join(sys.argv[1:])
17+
)
1218
sys.exit(1)

0 commit comments

Comments
 (0)