Skip to content

Commit 89bf38f

Browse files
committed
STY: Flake8 cleanup
1 parent a8a899b commit 89bf38f

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

nipype/pipeline/plugins/base.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,10 @@ def run(self, graph, config, updatehash=False):
129129
old_presub_stats = None
130130
while not np.all(self.proc_done) or np.any(self.proc_pending):
131131
loop_start = time()
132-
# Check to see if a job is available (jobs without dependencies not run)
133-
# See https://github.com/nipy/nipype/pull/2200#discussion_r141605722
134-
jobs_ready = np.nonzero(~self.proc_done & (self.depidx.sum(0) == 0))[1]
132+
# Check if a job is available (jobs with all dependencies run)
133+
# https://github.com/nipy/nipype/pull/2200#discussion_r141605722
134+
jobs_ready = np.nonzero(~self.proc_done &
135+
(self.depidx.sum(0) == 0))[1]
135136

136137
progress_stats = (len(self.proc_done),
137138
np.sum(self.proc_done ^ self.proc_pending),
@@ -165,7 +166,8 @@ def run(self, graph, config, updatehash=False):
165166
self._remove_node_dirs()
166167
self._clear_task(taskid)
167168
else:
168-
assert self.proc_done[jobid] and self.proc_pending[jobid]
169+
assert self.proc_done[jobid] and \
170+
self.proc_pending[jobid]
169171
toappend.insert(0, (taskid, jobid))
170172

171173
if toappend:
@@ -273,8 +275,8 @@ def _send_procs_to_workers(self, updatehash=False, graph=None):
273275
if (num_jobs >= self.max_jobs) or (slots == 0):
274276
break
275277

276-
# Check to see if a job is available (jobs without dependencies not run)
277-
# See https://github.com/nipy/nipype/pull/2200#discussion_r141605722
278+
# Check if a job is available (jobs with all dependencies run)
279+
# https://github.com/nipy/nipype/pull/2200#discussion_r141605722
278280
jobids = np.nonzero(~self.proc_done & (self.depidx.sum(0) == 0))[1]
279281

280282
if len(jobids) > 0:
@@ -327,7 +329,8 @@ def _send_procs_to_workers(self, updatehash=False, graph=None):
327329
break
328330

329331
def _local_hash_check(self, jobid, graph):
330-
if not str2bool(self.procs[jobid].config['execution']['local_hash_check']):
332+
if not str2bool(self.procs[jobid].config['execution'][
333+
'local_hash_check']):
331334
return False
332335

333336
logger.debug('Checking hash (%d) locally', jobid)
@@ -399,8 +402,8 @@ def _remove_node_dirs(self):
399402
"""Removes directories whose outputs have already been used up
400403
"""
401404
if str2bool(self._config['execution']['remove_node_directories']):
402-
for idx in np.nonzero(
403-
(self.refidx.sum(axis=1) == 0).__array__())[0]:
405+
indices = np.nonzero((self.refidx.sum(axis=1) == 0).__array__())[0]
406+
for idx in indices:
404407
if idx in self.mapnodesubids:
405408
continue
406409
if self.proc_done[idx] and (not self.proc_pending[idx]):
@@ -515,7 +518,8 @@ class GraphPluginBase(PluginBase):
515518

516519
def __init__(self, plugin_args=None):
517520
if plugin_args and plugin_args.get('status_callback'):
518-
logger.warning('status_callback not supported for Graph submission plugins')
521+
logger.warning('status_callback not supported for Graph submission'
522+
' plugins')
519523
super(GraphPluginBase, self).__init__(plugin_args=plugin_args)
520524

521525
def run(self, graph, config, updatehash=False):

0 commit comments

Comments
 (0)