Skip to content

Commit b174172

Browse files
committed
STY: black
1 parent 5bcc6ad commit b174172

File tree

2 files changed

+20
-30
lines changed

2 files changed

+20
-30
lines changed

docs/conf.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,17 +228,22 @@
228228

229229
apidoc_module_dir = "../smriprep"
230230
apidoc_output_dir = "api"
231-
apidoc_excluded_paths = ["conftest.py", "*/conftest.py", "*/tests/*", "tests/*", "data/*", "conf/*"]
231+
apidoc_excluded_paths = [
232+
"conftest.py",
233+
"*/conftest.py",
234+
"*/tests/*",
235+
"tests/*",
236+
"data/*",
237+
"conf/*",
238+
]
232239
apidoc_separate_modules = True
233240
apidoc_extra_args = ["--module-first", "-d 1", "-T"]
234241

235242
# Options for github links
236243
# The following is used by sphinx.ext.linkcode to provide links to github
237244
linkcode_resolve = make_linkcode_resolve(
238245
"smriprep",
239-
"https://github.com/nipreps/"
240-
"smriprep/blob/{revision}/"
241-
"{package}/{path}#L{lineno}",
246+
"https://github.com/nipreps/smriprep/blob/{revision}/{package}/{path}#L{lineno}",
242247
)
243248

244249
# -- Options for intersphinx extension ---------------------------------------

wrapper/smriprep_docker.py

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
import subprocess
2121

2222
__version__ = "99.99.99"
23-
__copyright__ = (
24-
"Copyright 2019, Center for Reproducible Neuroscience, Stanford University"
25-
)
23+
__copyright__ = "Copyright 2019, Center for Reproducible Neuroscience, Stanford University"
2624
__credits__ = [
2725
"Oscar Esteban",
2826
"Chris Gorgolewski",
@@ -87,9 +85,7 @@ def check_docker():
8785
1 Test run OK
8886
"""
8987
try:
90-
ret = subprocess.run(
91-
["docker", "version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE
92-
)
88+
ret = subprocess.run(["docker", "version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
9389
except OSError as e:
9490
from errno import ENOENT
9591

@@ -117,9 +113,7 @@ def check_memory(image):
117113
return -1
118114

119115
mem = [
120-
line.decode().split()[1]
121-
for line in ret.stdout.splitlines()
122-
if line.startswith(b"Mem:")
116+
line.decode().split()[1] for line in ret.stdout.splitlines() if line.startswith(b"Mem:")
123117
][0]
124118
return int(mem)
125119

@@ -170,7 +164,9 @@ def _get_posargs(usage):
170164

171165
# Make sure we're not clobbering options we don't mean to
172166
overlap = set(w_flags).intersection(t_flags)
173-
expected_overlap = set(["h", "version", "w", "fs-license-file", "use-plugin", "fs-subjects-dir"])
167+
expected_overlap = set(
168+
["h", "version", "w", "fs-license-file", "use-plugin", "fs-subjects-dir"]
169+
)
174170

175171
assert overlap == expected_overlap, "Clobbering options: {}".format(
176172
", ".join(overlap - expected_overlap)
@@ -339,12 +335,8 @@ def _is_file(path, parser):
339335
metavar=("ENV_VAR", "value"),
340336
help="Set custom environment variable within container",
341337
)
342-
g_dev.add_argument(
343-
"-u", "--user", action="store", help="Run container as a given user/uid"
344-
)
345-
g_dev.add_argument(
346-
"--no-tty", action="store_true", help="Run docker without TTY flag -it"
347-
)
338+
g_dev.add_argument("-u", "--user", action="store", help="Run container as a given user/uid")
339+
g_dev.add_argument("--no-tty", action="store_true", help="Run docker without TTY flag -it")
348340

349341
return parser
350342

@@ -398,10 +390,7 @@ def main():
398390
"Do you have permission to run docker?"
399391
)
400392
return 1
401-
if (
402-
not (opts.help or opts.version or "--reports-only" in unknown_args)
403-
and mem_total < 8000
404-
):
393+
if not (opts.help or opts.version or "--reports-only" in unknown_args) and mem_total < 8000:
405394
print(
406395
"Warning: <8GB of RAM is available within your Docker "
407396
"environment.\nSome parts of sMRIPrep may fail to complete."
@@ -445,9 +434,7 @@ def main():
445434
command.extend(["-u", opts.user])
446435

447436
if opts.fs_license_file:
448-
command.extend(
449-
["-v", "{}:/opt/freesurfer/license.txt:ro".format(opts.fs_license_file)]
450-
)
437+
command.extend(["-v", "{}:/opt/freesurfer/license.txt:ro".format(opts.fs_license_file)])
451438

452439
main_args = []
453440
if opts.bids_dir:
@@ -467,9 +454,7 @@ def main():
467454
unknown_args.extend(['--fs-subjects-dir', '/opt/subjects'])
468455

469456
if opts.config:
470-
command.extend(
471-
["-v", ":".join((opts.config, "/home/smriprep/.nipype/nipype.cfg", "ro"))]
472-
)
457+
command.extend(["-v", ":".join((opts.config, "/home/smriprep/.nipype/nipype.cfg", "ro"))])
473458

474459
if opts.use_plugin:
475460
command.extend(["-v", ":".join((opts.use_plugin, "/tmp/plugin.yml", "ro"))])

0 commit comments

Comments
 (0)