Skip to content

Commit 8f7b783

Browse files
author
Shoshana Berleant
committed
Merge branch 'installation'
2 parents b9ac4e8 + d375c2a commit 8f7b783

File tree

11 files changed

+40
-48
lines changed

11 files changed

+40
-48
lines changed

doc/users/install.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ or::
8383

8484
nosetests --with-doctest nipype
8585

86+
or::
87+
88+
nosetests --with-doctest nipype
89+
8690
A successful test run should complete in a few minutes and end with
8791
something like::
8892

doc/users/pipeline_tutorial.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Requirements
4949
- FSL_, FreeSurfer_, Camino_, ConnectomeViewer and MATLAB_ are available and
5050
callable from the command line
5151

52-
- SPM_ 5/8 is installed and callable in matlab
52+
- SPM_ 5/8/12 is installed and callable in matlab
5353

5454
- Space: 3-10 GB
5555

nipype/algorithms/misc.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from __future__ import division
1616
from builtins import zip
1717
from builtins import range
18-
from future.utils import raise_from
1918

2019
import os
2120
import os.path as op
@@ -858,9 +857,9 @@ def __init__(self, infields=None, force_run=True, **kwargs):
858857
def _run_interface(self, runtime):
859858
try:
860859
import pandas as pd
861-
except ImportError as e:
862-
raise_from(ImportError('This interface requires pandas '
863-
'(http://pandas.pydata.org/) to run.'), e)
860+
except ImportError:
861+
raise ImportError(('This interface requires pandas '
862+
'(http://pandas.pydata.org/) to run.'))
864863

865864
try:
866865
import lockfile as pl

nipype/external/six.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
# SOFTWARE.
2222

2323
from __future__ import absolute_import
24-
from future.utils import raise_from
2524

2625
import functools
2726
import itertools
@@ -187,8 +186,8 @@ def find_module(self, fullname, path=None):
187186
def __get_module(self, fullname):
188187
try:
189188
return self.known_modules[fullname]
190-
except KeyError as e:
191-
raise_from(ImportError("This loader does not know module " + fullname), e)
189+
except KeyError:
190+
raise ImportError("This loader does not know module " + fullname)
192191

193192
def load_module(self, fullname):
194193
try:

nipype/interfaces/afni/base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import os
66
from sys import platform
77
from builtins import object
8-
from future.utils import raise_from
98

109
from ... import logging
1110
from ...utils.filemanip import split_filename
@@ -83,9 +82,9 @@ def outputtype_to_ext(cls, outputtype):
8382

8483
try:
8584
return cls.ftypes[outputtype]
86-
except KeyError as e:
85+
except KeyError:
8786
msg = 'Invalid AFNIOUTPUTTYPE: ', outputtype
88-
raise_from(KeyError(msg), e)
87+
raise KeyError(msg)
8988

9089
@classmethod
9190
def outputtype(cls):

nipype/pipeline/plugins/ipython.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from future import standard_library
77
standard_library.install_aliases()
8-
from future.utils import raise_from
98

109
from pickle import dumps
1110

@@ -64,20 +63,19 @@ def run(self, graph, config, updatehash=False):
6463
name = 'ipyparallel'
6564
__import__(name)
6665
self.iparallel = sys.modules[name]
67-
except ImportError as e:
68-
raise_from(ImportError("Ipython kernel not found. Parallel execution "
69-
"will be unavailable"), e)
66+
except ImportError:
67+
raise ImportError("Ipython kernel not found. Parallel execution "
68+
"will be unavailable")
7069
try:
7170
self.taskclient = self.iparallel.Client()
7271
except Exception as e:
7372
if isinstance(e, TimeoutError):
74-
raise_from(Exception("No IPython clients found."), e)
73+
raise Exception("No IPython clients found.")
7574
if isinstance(e, IOError):
76-
raise_from(Exception("ipcluster/ipcontroller has not been started"), e)
75+
raise Exception("ipcluster/ipcontroller has not been started")
7776
if isinstance(e, ValueError):
78-
raise_from(Exception("Ipython kernel not installed"), e)
79-
else:
80-
raise e
77+
raise Exception("Ipython kernel not installed")
78+
raise e
8179
return super(IPythonPlugin, self).run(graph, config, updatehash=updatehash)
8280

8381
def _get_result(self, taskid):

nipype/pipeline/plugins/ipythonx.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"""
55

66
import sys
7-
from future.utils import raise_from
87

98
IPython_not_loaded = False
109
try:
@@ -37,16 +36,16 @@ def run(self, graph, config, updatehash=False):
3736
name = 'IPython.kernel.client'
3837
__import__(name)
3938
self.ipyclient = sys.modules[name]
40-
except ImportError as e:
41-
raise_from(ImportError("Ipython kernel not found. Parallel execution "
42-
"will be unavailable"), e)
39+
except ImportError:
40+
raise ImportError("Ipython kernel not found. Parallel execution "
41+
"will be unavailable")
4342
try:
4443
self.taskclient = self.ipyclient.TaskClient()
4544
except Exception as e:
4645
if isinstance(e, ConnectionRefusedError):
47-
raise_from(Exception("No IPython clients found."), e)
46+
raise Exception("No IPython clients found.")
4847
if isinstance(e, ValueError):
49-
raise_from(Exception("Ipython kernel not installed"), e)
48+
raise Exception("Ipython kernel not installed")
5049
return super(IPythonXPlugin, self).run(graph, config, updatehash=updatehash)
5150

5251
def _get_result(self, taskid):

nipype/testing/utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from tempfile import mkdtemp
1313
from ..utils.misc import package_check
1414
from nose import SkipTest
15-
from future.utils import raise_from
15+
1616

1717
def skip_if_no_package(*args, **kwargs):
1818
"""Raise SkipTest if package_check fails
@@ -62,15 +62,15 @@ def __init__(self, size_in_mbytes=8, delay=0.5):
6262
try:
6363
subprocess.check_call(args=mkfs_args, stdout=self.dev_null,
6464
stderr=self.dev_null)
65-
except subprocess.CalledProcessError as e:
66-
raise_from(IOError("mkfs.vfat failed"), e)
65+
except subprocess.CalledProcessError:
66+
raise IOError("mkfs.vfat failed")
6767

6868
try:
6969
self.fusefat = subprocess.Popen(args=mount_args,
7070
stdout=self.dev_null,
7171
stderr=self.dev_null)
72-
except OSError as e:
73-
raise_from(IOError("fusefat is not installed"), e)
72+
except OSError:
73+
raise IOError("fusefat is not installed")
7474

7575
time.sleep(self.delay)
7676

nipype/utils/misc.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from future import standard_library
77
standard_library.install_aliases()
8-
from future.utils import raise_from
98
from builtins import next
109
from pickle import dumps, loads
1110
import inspect
@@ -91,14 +90,14 @@ def create_function_from_source(function_source, imports=None):
9190
import_keys = list(ns.keys())
9291
exec(function_source, ns)
9392

94-
except Exception as e:
95-
msg = '\nError executing function:\n %s\n' % function_source
93+
except Exception as msg:
94+
msg = str(msg) + '\nError executing function:\n %s\n' % function_source
9695
msg += '\n'.join(["Functions in connection strings have to be standalone.",
9796
"They cannot be declared either interactively or inside",
9897
"another function or inline in the connect string. Any",
9998
"imports should be done inside the function"
10099
])
101-
raise_from(RuntimeError(msg), e)
100+
raise RuntimeError(msg)
102101
ns_funcs = list(set(ns) - set(import_keys + ['__builtins__']))
103102
assert len(ns_funcs) == 1, "Function or inputs are ill-defined"
104103
funcname = ns_funcs[0]
@@ -200,14 +199,14 @@ def package_check(pkg_name, version=None, app=None, checker=LooseVersion,
200199
msg += ' with version >= %s' % (version,)
201200
try:
202201
mod = __import__(pkg_name)
203-
except ImportError as e:
204-
raise_from(exc_failed_import(msg), e)
202+
except ImportError:
203+
raise exc_failed_import(msg)
205204
if not version:
206205
return
207206
try:
208207
have_version = mod.__version__
209-
except AttributeError as e:
210-
raise_from(exc_failed_check('Cannot find version for %s' % pkg_name), e)
208+
except AttributeError:
209+
raise exc_failed_check('Cannot find version for %s' % pkg_name)
211210
if checker(have_version) < checker(version):
212211
raise exc_failed_check(msg)
213212

nipype/utils/spm_docs.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import os
66

7-
from future.utils import raise_from
87
from nipype.interfaces import matlab
98

109

@@ -56,5 +55,5 @@ def _strip_header(doc):
5655
except ValueError:
5756
index = len(doc)
5857
return doc[:index]
59-
except KeyError as e:
60-
raise_from(IOError('This docstring was not generated by Nipype!\n'), e)
58+
except KeyError:
59+
raise IOError('This docstring was not generated by Nipype!\n')

nipype/workflows/dmri/connectivity/group_connectivity.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
asdf;alksjahgldhjgioae
2-
3-
41
from __future__ import print_function
5-
from future.utils import raise_from
62

73
import os.path as op
84

@@ -463,9 +459,9 @@ def create_average_networks_by_group_workflow(group_list, data_dir, subjects_dir
463459
try:
464460
l4infosource.inputs.group_id1 = list(group_list.keys())[0]
465461
l4infosource.inputs.group_id2 = list(group_list.keys())[1]
466-
except IndexError as e:
462+
except IndexError:
467463
print('The create_average_networks_by_group_workflow requires 2 groups')
468-
raise_from(Exception(), e)
464+
raise Exception
469465

470466
l4info = dict(networks=[['group_id', '']], CMatrices=[['group_id', '']], fibmean=[['group_id', 'mean_fiber_length']],
471467
fibdev=[['group_id', 'fiber_length_std']])

0 commit comments

Comments
 (0)