Skip to content

Commit d3db782

Browse files
committed
Merge branch 'master' into enh/ImprovedNosetestsVerbosity
2 parents ca42ca8 + 52d64c3 commit d3db782

File tree

971 files changed

+16672
-14189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

971 files changed

+16672
-14189
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
/nipype/build
66
/nipype/nipype.egg-info
77
/doc/_build
8+
/doc/preproc
89
/doc/users/examples
910
/doc/api/generated
1011
*.pyc
@@ -17,3 +18,6 @@
1718
.DS_Store
1819
nipype/testing/data/von-ray_errmap.nii.gz
1920
nipype/testing/data/von_errmap.nii.gz
21+
crash*.pklz
22+
.coverage
23+
htmlcov/

.travis.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ cache:
33
language: python
44
python:
55
- 2.7
6+
- 3.4
67
env:
78
- INSTALL_DEB_DEPENDECIES=true
89
- INSTALL_DEB_DEPENDECIES=false
910
before_install:
10-
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh
11-
-O miniconda.sh; else wget http://repo.continuum.io/miniconda/Miniconda3-3.6.0-Linux-x86_64.sh
11+
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then wget http://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
12+
-O miniconda.sh; else wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
1213
-O miniconda.sh; fi
1314
- chmod +x miniconda.sh
1415
- "./miniconda.sh -b"
15-
- export PATH=/home/travis/miniconda/bin:$PATH
16+
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then export PATH=/home/travis/miniconda2/bin:$PATH; else export PATH=/home/travis/miniconda3/bin:$PATH; fi
1617
- if $INSTALL_DEB_DEPENDECIES; then sudo rm -rf /dev/shm; fi
1718
- if $INSTALL_DEB_DEPENDECIES; then sudo ln -s /run/shm /dev/shm; fi
1819
- if $INSTALL_DEB_DEPENDECIES; then bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh);
@@ -27,15 +28,16 @@ install:
2728
- conda create -n testenv --yes pip python=$TRAVIS_PYTHON_VERSION
2829
- source activate testenv
2930
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then pip install ordereddict; fi
30-
- conda install --yes numpy scipy nose traits networkx dateutil
31-
- pip install nibabel
31+
- conda install --yes numpy scipy nose networkx dateutil
32+
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then conda install --yes traits; else pip install traits; fi
3233
- pip install python-coveralls
3334
- pip install nose-cov
35+
- pip install -r requirements.txt # finish remaining requirements
3436
- pip install https://github.com/RDFLib/rdflib/archive/master.zip
3537
- pip install https://github.com/trungdong/prov/archive/rdf.zip
3638
- python setup.py install
3739
script:
38-
- nosetests --with-doctest --with-cov --cov nipype --cov-config .coveragerc --logging-level=INFO
40+
- python -W once:FSL:UserWarning:nipype `which nosetests` --with-doctest --with-cov --cover-package nipype --cov-config .coveragerc --logging-level=INFO
3941
after_success:
4042
- coveralls --config_file .coveragerc
4143
deploy:

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Next Release
22
============
3+
4+
* ENH: Added an OAR scheduler plugin (https://github.com/nipy/nipype/pull/1259)
5+
* ENH: New ANTs interface: antsBrainExtraction (https://github.com/nipy/nipype/pull/1231)
36
* API: Default model level for the bedpostx workflow has been set to "2" following FSL 5.0.9 lead
47
* ENH: New interfaces for interacting with AWS S3: S3DataSink and S3DataGrabber (https://github.com/nipy/nipype/pull/1201)
58

THANKS.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ Contributors to Nipype include but are not limited to:
1010
* Aimi Watanabe
1111
* Alexander Schaefer
1212
* Alexandre Gramfort
13+
* Alexandre Savio
1314
* Anisha Keshavan
1415
* Ariel Rokem
1516
* Ben Acland
17+
* Ben Cipollini
1618
* Basile Pinsard
1719
* Brendan Moloney
1820
* Brian Cheung

build_docs.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
python setup.py build_sphinx
99
"""
1010

11+
from __future__ import print_function
12+
1113
# Standard library imports
1214
import sys
1315
import os
@@ -27,23 +29,25 @@
2729

2830
################################################################################
2931
# Distutils Command class for installing nipype to a temporary location.
32+
33+
3034
class TempInstall(Command):
3135
temp_install_dir = os.path.join('build', 'install')
3236

3337
def run(self):
3438
""" build and install nipype in a temporary location. """
3539
install = self.distribution.get_command_obj('install')
3640
install.install_scripts = self.temp_install_dir
37-
install.install_base = self.temp_install_dir
41+
install.install_base = self.temp_install_dir
3842
install.install_platlib = self.temp_install_dir
3943
install.install_purelib = self.temp_install_dir
40-
install.install_data = self.temp_install_dir
41-
install.install_lib = self.temp_install_dir
44+
install.install_data = self.temp_install_dir
45+
install.install_lib = self.temp_install_dir
4246
install.install_headers = self.temp_install_dir
4347
install.run()
4448

4549
# Horrible trick to reload nipype with our temporary instal
46-
for key in sys.modules.keys():
50+
for key in list(sys.modules.keys()):
4751
if key.startswith('nipype'):
4852
sys.modules.pop(key, None)
4953
sys.path.append(os.path.abspath(self.temp_install_dir))
@@ -62,12 +66,11 @@ def finalize_options(self):
6266
# Distutils Command class for API generation
6367
class APIDocs(TempInstall):
6468
description = \
65-
"""generate API docs """
69+
"""generate API docs """
6670

6771
user_options = [
6872
('None', None, 'this command has no options'),
69-
]
70-
73+
]
7174

7275
def run(self):
7376
# First build the project and install it to a temporary location.
@@ -131,30 +134,29 @@ def run(self):
131134

132135
def zip_docs(self):
133136
if not os.path.exists(DOC_BUILD_DIR):
134-
raise OSError, 'Doc directory does not exist.'
137+
raise OSError('Doc directory does not exist.')
135138
target_file = os.path.join('doc', 'documentation.zip')
136139
# ZIP_DEFLATED actually compresses the archive. However, there
137140
# will be a RuntimeError if zlib is not installed, so we check
138141
# for it. ZIP_STORED produces an uncompressed zip, but does not
139142
# require zlib.
140143
try:
141144
zf = zipfile.ZipFile(target_file, 'w',
142-
compression=zipfile.ZIP_DEFLATED)
145+
compression=zipfile.ZIP_DEFLATED)
143146
except RuntimeError:
144147
warnings.warn('zlib not installed, storing the docs '
145-
'without compression')
148+
'without compression')
146149
zf = zipfile.ZipFile(target_file, 'w',
147-
compression=zipfile.ZIP_STORED)
150+
compression=zipfile.ZIP_STORED)
148151

149152
for root, dirs, files in os.walk(DOC_BUILD_DIR):
150153
relative = relative_path(root)
151154
if not relative.startswith('.doctrees'):
152155
for f in files:
153156
zf.write(os.path.join(root, f),
154-
os.path.join(relative, 'html_docs', f))
157+
os.path.join(relative, 'html_docs', f))
155158
zf.close()
156159

157-
158160
def finalize_options(self):
159161
""" Override the default for the documentation build
160162
directory.
@@ -164,23 +166,25 @@ def finalize_options(self):
164166

165167
################################################################################
166168
# Distutils Command class to clean
169+
170+
167171
class Clean(clean):
168172

169173
def run(self):
170174
clean.run(self)
171175
api_path = os.path.join('doc', 'api', 'generated')
172176
if os.path.exists(api_path):
173-
print "Removing %s" % api_path
177+
print("Removing %s" % api_path)
174178
shutil.rmtree(api_path)
175179
interface_path = os.path.join('doc', 'interfaces', 'generated')
176180
if os.path.exists(interface_path):
177-
print "Removing %s" % interface_path
181+
print("Removing %s" % interface_path)
178182
shutil.rmtree(interface_path)
179183
if os.path.exists(DOC_BUILD_DIR):
180-
print "Removing %s" % DOC_BUILD_DIR
184+
print("Removing %s" % DOC_BUILD_DIR)
181185
shutil.rmtree(DOC_BUILD_DIR)
182186
if os.path.exists(DOC_DOCTREES_DIR):
183-
print "Removing %s" % DOC_DOCTREES_DIR
187+
print("Removing %s" % DOC_DOCTREES_DIR)
184188
shutil.rmtree(DOC_DOCTREES_DIR)
185189

186190

@@ -189,5 +193,3 @@ def run(self):
189193
'api_docs': APIDocs,
190194
'clean': Clean,
191195
}
192-
193-

circle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies:
1515
- if [[ ! -d ~/fsl ]]; then wget "http://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-5.0.9-centos6_64.tar.gz"; tar zxvf fsl-5.0.9-centos6_64.tar.gz; mv fsl ~/fsl; fi
1616
- if [[ ! -d ~/examples/data ]]; then wget "http://tcpdiag.dl.sourceforge.net/project/nipy/nipype/nipype-0.2/nipype-tutorial.tar.bz2"; tar jxvf nipype-tutorial.tar.bz2; mkdir ~/examples; mv nipype-tutorial/* ~/examples/; fi
1717
# we download this manually because CircleCI does not cache apt
18-
- if [[ ! -d ~/examples/feeds ]]; then wget "http://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-5.0.8-feeds.tar.gz"; tar zxvf fsl-5.0.8-feeds.tar.gz; mv feeds ~/examples/; fi
18+
- if [[ ! -d ~/examples/feeds ]]; then wget "http://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-5.0.9-feeds.tar.gz"; tar zxvf fsl-5.0.8-feeds.tar.gz; mv feeds ~/examples/; fi
1919
- if [[ ! -d ~/examples/fsl_course_data ]]; then wget -c "http://fsl.fmrib.ox.ac.uk/fslcourse/fdt1.tar.gz" ; wget -c "http://fsl.fmrib.ox.ac.uk/fslcourse/fdt2.tar.gz"; wget -c "http://fsl.fmrib.ox.ac.uk/fslcourse/tbss.tar.gz"; mkdir ~/examples/fsl_course_data; tar zxvf fdt1.tar.gz -C ~/examples/fsl_course_data; tar zxvf fdt2.tar.gz -C ~/examples/fsl_course_data; tar zxvf tbss.tar.gz -C ~/examples/fsl_course_data; fi
2020
- bash ~/nipype/tools/install_spm_mcr.sh
2121
- mkdir -p ~/.nipype && echo "[logging]" > ~/.nipype/nipype.cfg && echo "workflow_level = DEBUG" >> ~/.nipype/nipype.cfg && echo "interface_level = DEBUG" >> ~/.nipype/nipype.cfg && echo "filemanip_level = DEBUG" >> ~/.nipype/nipype.cfg

doc/conf.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
# All configuration values have a default; values that are commented out
1313
# serve to show the default.
1414

15-
import sys, os
15+
import sys
16+
import os
1617

1718
nipypepath = os.path.abspath('..')
18-
sys.path.insert(1,nipypepath)
19+
sys.path.insert(1, nipypepath)
1920

2021
import nipype
2122

@@ -168,9 +169,9 @@
168169
#html_use_smartypants = True
169170

170171
# Custom sidebar templates, maps document names to template names.
171-
html_sidebars = {'**': ['gse.html','localtoc.html', 'sidebar_versions.html', 'indexsidebar.html'],
172-
'searchresults' : ['sidebar_versions.html', 'indexsidebar.html'],
173-
'version' : []}
172+
html_sidebars = {'**': ['gse.html', 'localtoc.html', 'sidebar_versions.html', 'indexsidebar.html'],
173+
'searchresults': ['sidebar_versions.html', 'indexsidebar.html'],
174+
'version': []}
174175

175176
# Additional templates that should be rendered to pages, maps page names to
176177
# template names.
@@ -211,8 +212,8 @@
211212
# Grouping the document tree into LaTeX files. List of tuples
212213
# (source start file, target name, title, author, documentclass [howto/manual]).
213214
latex_documents = [
214-
('documentation', 'nipype.tex', u'nipype Documentation',
215-
u'Neuroimaging in Python team', 'manual'),
215+
('documentation', 'nipype.tex', u'nipype Documentation',
216+
u'Neuroimaging in Python team', 'manual'),
216217
]
217218

218219
# The name of an image file (relative to this directory) to place at the top of

doc/devel/matlab_interface_devel.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ By subclassing **MatlabCommand** for your main class, and **MatlabInputSpec** fo
9393
>>> hello = HelloWorld()
9494
>>> hello.inputs.name = 'hello_world'
9595
>>> out = hello.run()
96-
>>> print out.outputs.matlab_output
96+
>>> print(out.outputs.matlab_output)
9797
"""
9898
input_spec = HelloWorldInputSpec
9999
output_spec = HelloWorldOutputSpec

doc/devel/python_interface_devel.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ do is to define inputs, outputs, _run_interface() (not run()), and _list_outputs
4141
thresholded_map = np.zeros(data.shape)
4242
thresholded_map[active_map] = data[active_map]
4343

44-
new_img = nb.Nifti1Image(thresholded_map, img.get_affine(), img.get_header())
44+
new_img = nb.Nifti1Image(thresholded_map, img.affine, img.header)
4545
_, base, _ = split_filename(fname)
4646
nb.save(new_img, base + '_thresholded.nii')
4747

doc/sphinxext/autosummary_generate.py

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,22 @@
1616
./ext/autosummary_generate.py -o source/generated source/*.rst
1717
1818
"""
19-
import glob, re, inspect, os, optparse, pydoc
19+
20+
from __future__ import print_function
21+
import glob
22+
import re
23+
import inspect
24+
import os
25+
import optparse
26+
import pydoc
2027
from autosummary import import_by_name
2128

2229
try:
2330
from phantom_import import import_phantom_module
2431
except ImportError:
2532
import_phantom_module = lambda x: x
2633

34+
2735
def main():
2836
p = optparse.OptionParser(__doc__.strip())
2937
p.add_option("-p", "--phantom", action="store", type="string",
@@ -44,7 +52,7 @@ def main():
4452

4553
# read
4654
names = {}
47-
for name, loc in get_documented(args).items():
55+
for name, loc in list(get_documented(args).items()):
4856
for (filename, sec_title, keyword, toctree) in loc:
4957
if toctree is not None:
5058
path = os.path.join(os.path.dirname(filename), toctree)
@@ -60,8 +68,8 @@ def main():
6068

6169
try:
6270
obj, name = import_by_name(name)
63-
except ImportError, e:
64-
print "Failed to import '%s': %s" % (name, e)
71+
except ImportError as e:
72+
print("Failed to import '%s': %s" % (name, e))
6573
continue
6674

6775
fn = os.path.join(path, '%s.rst' % name)
@@ -73,7 +81,7 @@ def main():
7381
f = open(fn, 'w')
7482

7583
try:
76-
f.write('%s\n%s\n\n' % (name, '='*len(name)))
84+
f.write('%s\n%s\n\n' % (name, '=' * len(name)))
7785

7886
if inspect.isclass(obj):
7987
if issubclass(obj, Exception):
@@ -93,16 +101,19 @@ def main():
93101
finally:
94102
f.close()
95103

104+
96105
def format_modulemember(name, directive):
97106
parts = name.split('.')
98107
mod, name = '.'.join(parts[:-1]), parts[-1]
99108
return ".. currentmodule:: %s\n\n.. %s:: %s\n" % (mod, directive, name)
100109

110+
101111
def format_classmember(name, directive):
102112
parts = name.split('.')
103113
mod, name = '.'.join(parts[:-2]), '.'.join(parts[-2:])
104114
return ".. currentmodule:: %s\n\n.. %s:: %s\n" % (mod, directive, name)
105115

116+
106117
def get_documented(filenames):
107118
"""
108119
Find out what items are documented in source/*.rst
@@ -117,6 +128,7 @@ def get_documented(filenames):
117128
f.close()
118129
return documented
119130

131+
120132
def get_documented_in_docstring(name, module=None, filename=None):
121133
"""
122134
Find out what items are documented in the given object's docstring.
@@ -129,10 +141,11 @@ def get_documented_in_docstring(name, module=None, filename=None):
129141
return get_documented_in_lines(lines, module=name, filename=filename)
130142
except AttributeError:
131143
pass
132-
except ImportError, e:
133-
print "Failed to import '%s': %s" % (name, e)
144+
except ImportError as e:
145+
print("Failed to import '%s': %s" % (name, e))
134146
return {}
135147

148+
136149
def get_documented_in_lines(lines, module=None, filename=None):
137150
"""
138151
Find out what items are documented in the given lines
@@ -171,7 +184,7 @@ def get_documented_in_lines(lines, module=None, filename=None):
171184
continue
172185

173186
if line.strip().startswith(':'):
174-
continue # skip options
187+
continue # skip options
175188

176189
m = autosummary_item_re.match(line)
177190
if m:
@@ -197,7 +210,7 @@ def get_documented_in_lines(lines, module=None, filename=None):
197210
current_module = name
198211
documented.update(get_documented_in_docstring(
199212
name, filename=filename))
200-
elif current_module and not name.startswith(current_module+'.'):
213+
elif current_module and not name.startswith(current_module + '.'):
201214
name = "%s.%s" % (current_module, name)
202215
documented.setdefault(name, []).append(
203216
(filename, current_title, "auto" + m.group(1), None))

0 commit comments

Comments
 (0)