Skip to content

Commit 9a609b6

Browse files
committed
do not access __array__() of matrices (now base plugin)
1 parent b9537b5 commit 9a609b6

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

nipype/pipeline/plugins/base.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ def __init__(self, plugin_args=None):
207207
"""Initialize runtime attributes to none
208208
209209
procs: list (N) of underlying interface elements to be processed
210-
proc_done: a boolean vector (N) signifying whether a process has been
210+
proc_done: a boolean numpy array (N) signifying whether a process has been
211211
executed
212-
proc_pending: a boolean vector (N) signifying whether a
212+
proc_pending: a boolean numpy array (N) signifying whether a
213213
process is currently running. Note: A process is finished only when
214214
both proc_done==True and
215215
proc_pending==False
@@ -360,14 +360,14 @@ def _send_procs_to_workers(self, updatehash=False, graph=None):
360360
if (num_jobs >= self.max_jobs) or (slots == 0):
361361
break
362362
# Check to see if a job is available
363-
jobids = np.flatnonzero((self.proc_done == False) &
364-
(self.depidx.sum(axis=0) == 0).__array__())
363+
jobids = np.flatnonzero(
364+
~self.proc_done & ~np.sum(self.depidx, axis=0).astype(bool))
365+
365366
if len(jobids) > 0:
366367
# send all available jobs
367-
if slots:
368-
logger.info('Pending[%d] Submitting[%d] jobs Slots[%d]' % (num_jobs, len(jobids[:slots]), slots))
369-
else:
370-
logger.info('Pending[%d] Submitting[%d] jobs Slots[inf]' % (num_jobs, len(jobids)))
368+
logger.info('Pending[%d] Submitting[%d] jobs Slots[%d]',
369+
num_jobs, len(jobids[:slots]), slots or 'inf')
370+
371371
for jobid in jobids[:slots]:
372372
if isinstance(self.procs[jobid], MapNode):
373373
try:
@@ -478,8 +478,7 @@ def _remove_node_dirs(self):
478478
"""Removes directories whose outputs have already been used up
479479
"""
480480
if str2bool(self._config['execution']['remove_node_directories']):
481-
for idx in np.nonzero(
482-
(self.refidx.sum(axis=1) == 0).__array__())[0]:
481+
for idx in np.nonzero(np.sum(self.refidx, axis=1) == 0)[0]:
483482
if idx in self.mapnodesubids:
484483
continue
485484
if self.proc_done[idx] and (not self.proc_pending[idx]):

0 commit comments

Comments
 (0)