Skip to content

Commit 0110028

Browse files
committed
Merge remote-tracking branch 'upstream/master' into oar_support
Conflicts: CHANGES
2 parents c61b959 + f4f31b5 commit 0110028

File tree

948 files changed

+13832
-12171
lines changed

Some content is hidden

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

948 files changed

+13832
-12171
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Next Release
22
============
33

44
* 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)
56
* API: Default model level for the bedpostx workflow has been set to "2" following FSL 5.0.9 lead
67
* ENH: New interfaces for interacting with AWS S3: S3DataSink and S3DataGrabber (https://github.com/nipy/nipype/pull/1201)
78

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: 20 additions & 16 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,13 +66,12 @@ 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'),
6973
]
7074

71-
7275
def run(self):
7376
# First build the project and install it to a temporary location.
7477
TempInstall.run(self)
@@ -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

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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import sys, os
1616

1717
nipypepath = os.path.abspath('..')
18-
sys.path.insert(1,nipypepath)
18+
sys.path.insert(1, nipypepath)
1919

2020
import nipype
2121

@@ -168,9 +168,9 @@
168168
#html_use_smartypants = True
169169

170170
# 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' : []}
171+
html_sidebars = {'**': ['gse.html', 'localtoc.html', 'sidebar_versions.html', 'indexsidebar.html'],
172+
'searchresults': ['sidebar_versions.html', 'indexsidebar.html'],
173+
'version': []}
174174

175175
# Additional templates that should be rendered to pages, maps page names to
176176
# template names.

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/sphinxext/autosummary_generate.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
./ext/autosummary_generate.py -o source/generated source/*.rst
1717
1818
"""
19+
20+
from __future__ import print_function
1921
import glob, re, inspect, os, optparse, pydoc
2022
from autosummary import import_by_name
2123

@@ -24,6 +26,7 @@
2426
except ImportError:
2527
import_phantom_module = lambda x: x
2628

29+
2730
def main():
2831
p = optparse.OptionParser(__doc__.strip())
2932
p.add_option("-p", "--phantom", action="store", type="string",
@@ -44,7 +47,7 @@ def main():
4447

4548
# read
4649
names = {}
47-
for name, loc in get_documented(args).items():
50+
for name, loc in list(get_documented(args).items()):
4851
for (filename, sec_title, keyword, toctree) in loc:
4952
if toctree is not None:
5053
path = os.path.join(os.path.dirname(filename), toctree)
@@ -60,8 +63,8 @@ def main():
6063

6164
try:
6265
obj, name = import_by_name(name)
63-
except ImportError, e:
64-
print "Failed to import '%s': %s" % (name, e)
66+
except ImportError as e:
67+
print("Failed to import '%s': %s" % (name, e))
6568
continue
6669

6770
fn = os.path.join(path, '%s.rst' % name)
@@ -93,16 +96,19 @@ def main():
9396
finally:
9497
f.close()
9598

99+
96100
def format_modulemember(name, directive):
97101
parts = name.split('.')
98102
mod, name = '.'.join(parts[:-1]), parts[-1]
99103
return ".. currentmodule:: %s\n\n.. %s:: %s\n" % (mod, directive, name)
100104

105+
101106
def format_classmember(name, directive):
102107
parts = name.split('.')
103108
mod, name = '.'.join(parts[:-2]), '.'.join(parts[-2:])
104109
return ".. currentmodule:: %s\n\n.. %s:: %s\n" % (mod, directive, name)
105110

111+
106112
def get_documented(filenames):
107113
"""
108114
Find out what items are documented in source/*.rst
@@ -117,6 +123,7 @@ def get_documented(filenames):
117123
f.close()
118124
return documented
119125

126+
120127
def get_documented_in_docstring(name, module=None, filename=None):
121128
"""
122129
Find out what items are documented in the given object's docstring.
@@ -129,10 +136,11 @@ def get_documented_in_docstring(name, module=None, filename=None):
129136
return get_documented_in_lines(lines, module=name, filename=filename)
130137
except AttributeError:
131138
pass
132-
except ImportError, e:
133-
print "Failed to import '%s': %s" % (name, e)
139+
except ImportError as e:
140+
print("Failed to import '%s': %s" % (name, e))
134141
return {}
135142

143+
136144
def get_documented_in_lines(lines, module=None, filename=None):
137145
"""
138146
Find out what items are documented in the given lines
@@ -171,7 +179,7 @@ def get_documented_in_lines(lines, module=None, filename=None):
171179
continue
172180

173181
if line.strip().startswith(':'):
174-
continue # skip options
182+
continue # skip options
175183

176184
m = autosummary_item_re.match(line)
177185
if m:

doc/sphinxext/ipython_console_highlighting.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""reST directive for syntax-highlighting ipython interactive sessions.
44
"""
55

6-
#-----------------------------------------------------------------------------
6+
# -----------------------------------------------------------------------------
77
# Needed modules
88

99
# Standard library
@@ -18,13 +18,14 @@
1818
from sphinx import highlighting
1919

2020

21-
#-----------------------------------------------------------------------------
21+
# -----------------------------------------------------------------------------
2222
# Global constants
2323
line_re = re.compile('.*?\n')
2424

25-
#-----------------------------------------------------------------------------
25+
# -----------------------------------------------------------------------------
2626
# Code begins - classes and functions
2727

28+
2829
class IPythonConsoleLexer(Lexer):
2930
"""
3031
For IPython console output or doctests, such as:
@@ -95,6 +96,6 @@ def get_tokens_unprocessed(self, text):
9596
pylexer.get_tokens_unprocessed(curcode)):
9697
yield item
9798

98-
#-----------------------------------------------------------------------------
99+
# -----------------------------------------------------------------------------
99100
# Register the extension as a valid pygments lexer
100101
highlighting.lexers['ipython'] = IPythonConsoleLexer()

0 commit comments

Comments
 (0)