Skip to content

WIP/ENH: Allow client args as IPython plugin_args #1374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion nipype/pipeline/plugins/ipython.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ def __init__(self, plugin_args=None):
if IPython_not_loaded:
raise ImportError('ipyparallel could not be imported')
super(IPythonPlugin, self).__init__(plugin_args=plugin_args)
valid_args = ('url_file', 'profile', 'cluster_id', 'context', 'debug',
'timeout', 'config', 'username', 'sshserver', 'sshkey',
'password', 'paramiko')
self.client_args = {arg: plugin_args[arg]
for arg in valid_args if arg in plugin_args}
self.iparallel = None
self.taskclient = None
self.taskmap = {}
Expand All @@ -67,7 +72,7 @@ def run(self, graph, config, updatehash=False):
raise ImportError("Ipython kernel not found. Parallel execution "
"will be unavailable")
try:
self.taskclient = self.iparallel.Client()
self.taskclient = self.iparallel.Client(**self.client_args)
except Exception as e:
if isinstance(e, TimeoutError):
raise Exception("No IPython clients found.")
Expand Down