Skip to content

Commit 379375d

Browse files
authored
Merge pull request #1374 from effigies/ipython_plugin_args
WIP/ENH: Allow client args as IPython plugin_args
2 parents abe7920 + 2f762c2 commit 379375d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

nipype/pipeline/plugins/ipython.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ def __init__(self, plugin_args=None):
5050
if IPython_not_loaded:
5151
raise ImportError('Please install ipyparallel to use this plugin.')
5252
super(IPythonPlugin, self).__init__(plugin_args=plugin_args)
53+
valid_args = ('url_file', 'profile', 'cluster_id', 'context', 'debug',
54+
'timeout', 'config', 'username', 'sshserver', 'sshkey',
55+
'password', 'paramiko')
56+
self.client_args = {arg: plugin_args[arg]
57+
for arg in valid_args if arg in plugin_args}
5358
self.iparallel = None
5459
self.taskclient = None
5560
self.taskmap = {}
@@ -68,7 +73,7 @@ def run(self, graph, config, updatehash=False):
6873
raise_from(ImportError("ipyparallel not found. Parallel execution "
6974
"will be unavailable"), e)
7075
try:
71-
self.taskclient = self.iparallel.Client()
76+
self.taskclient = self.iparallel.Client(**self.client_args)
7277
except Exception as e:
7378
if isinstance(e, TimeoutError):
7479
raise_from(Exception("No IPython clients found."), e)

0 commit comments

Comments
 (0)