Skip to content

Commit 6a1e80b

Browse files
committed
Merged with master, fixed simple conflicts. Left changes from oesteban regarding encoding comment and imports for Python 3 compatability.
2 parents 04bb78c + 0f9a620 commit 6a1e80b

File tree

641 files changed

+5852
-5174
lines changed

Some content is hidden

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

641 files changed

+5852
-5174
lines changed

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.git/
2+
*.pyc
3+
*.egg-info
4+
__pycache__
5+
docker/nipype_*
6+
docker/test-*
7+
.coverage

.noserc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[nosetests]
22
verbosity=3
3-
43
logging-level=DEBUG
54
with-doctest=1
5+
with-doctest-ignore-unicode=1
6+
67
with-xunit=1
78
with-coverage=1
89
cover-branches=1

.travis.yml

Lines changed: 26 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,58 +8,42 @@ python:
88
env:
99
- INSTALL_DEB_DEPENDECIES=true
1010
- INSTALL_DEB_DEPENDECIES=false
11+
- INSTALL_DEB_DEPENDECIES=true DUECREDIT_ENABLE=yes
1112
before_install:
12-
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then wget http://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
13-
-O miniconda.sh; else wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
14-
-O miniconda.sh; fi
15-
- chmod +x miniconda.sh
16-
- "./miniconda.sh -b"
17-
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then export PATH=/home/travis/miniconda2/bin:$PATH; else export PATH=/home/travis/miniconda3/bin:$PATH; fi
13+
- wget http://repo.continuum.io/miniconda/Miniconda${TRAVIS_PYTHON_VERSION:0:1}-latest-Linux-x86_64.sh
14+
-O /home/travis/.cache/miniconda.sh
15+
- bash /home/travis/.cache/miniconda.sh -b -p /home/travis/miniconda
16+
- export PATH=/home/travis/miniconda/bin:$PATH
1817
- if $INSTALL_DEB_DEPENDECIES; then sudo rm -rf /dev/shm; fi
1918
- if $INSTALL_DEB_DEPENDECIES; then sudo ln -s /run/shm /dev/shm; fi
2019
- bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh)
21-
- sudo apt-get update
22-
- sudo apt-get install xvfb
23-
- if $INSTALL_DEB_DEPENDECIES; then travis_retry sudo apt-get install -qq --no-install-recommends
24-
fsl afni elastix; fi
25-
- if $INSTALL_DEB_DEPENDECIES; then travis_retry sudo apt-get install -qq fsl-atlases;
26-
fi
27-
- if $INSTALL_DEB_DEPENDECIES; then source /etc/fsl/fsl.sh; fi
28-
- if $INSTALL_DEB_DEPENDECIES; then source /etc/afni/afni.sh; fi
20+
- sudo apt-get -y update
21+
- sudo apt-get -y install xvfb fusefat
22+
- if $INSTALL_DEB_DEPENDECIES; then travis_retry sudo apt-get install -y -qq
23+
fsl afni elastix fsl-atlases; fi
24+
- if $INSTALL_DEB_DEPENDECIES; then
25+
source /etc/fsl/fsl.sh;
26+
source /etc/afni/afni.sh; fi
2927
- export FSLOUTPUTTYPE=NIFTI_GZ
30-
# Install vtk and fix numpy installation problem
31-
# Fix numpy problem: https://github.com/enthought/enable/issues/34#issuecomment-2029381
32-
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then travis_retry sudo apt-get install -qq libx11-dev swig;
33-
echo '[x11]' >> $HOME/.numpy-site.cfg;
34-
echo 'library_dirs = /usr/lib64:/usr/lib:/usr/lib/x86_64-linux-gnu' >> $HOME/.numpy-site.cfg;
35-
echo 'include_dirs = /usr/include:/usr/include/X11' >> $HOME/.numpy-site.cfg;
36-
fi
3728
install:
38-
- sudo apt-get install fusefat
29+
- conda config --add channels conda-forge
3930
- conda update --yes conda
40-
- conda create -n testenv --yes pip python=$TRAVIS_PYTHON_VERSION
41-
- source activate testenv
42-
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then pip install ordereddict; fi
43-
- conda install --yes numpy scipy nose networkx python-dateutil
44-
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then conda install --yes traits; else pip install traits; fi
45-
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then conda install --yes vtk; fi
46-
- pip install python-coveralls
47-
- pip install nose-cov
48-
# Add tvtk (PIL is required by blockcanvas)
49-
# Install mayavi (see https://github.com/enthought/mayavi/issues/271)
50-
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then
51-
pip install http://effbot.org/downloads/Imaging-1.1.7.tar.gz;
52-
pip install -e git+https://github.com/enthought/etsdevtools.git#egg=etsdevtools;
53-
pip install -e git+https://github.com/enthought/blockcanvas.git#egg=blockcanvas;
54-
pip install -e git+https://github.com/enthought/etsproxy.git#egg=etsproxy;
55-
pip install https://github.com/dmsurti/mayavi/archive/4d4aaf315a29d6a86707dd95149e27d9ed2225bf.zip;
56-
pip install -e git+https://github.com/enthought/ets.git#egg=ets;
57-
fi
31+
- conda update --all -y python=$TRAVIS_PYTHON_VERSION
32+
# - if [[ "${INSTALL_DEB_DEPENDECIES}" == "true" && ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]]; then
33+
# conda install -y vtk mayavi; fi
34+
- conda install -y nipype
35+
- pip install python-coveralls coverage doctest-ignore-unicode
36+
- if [ ! -z "$DUECREDIT_ENABLE"]; then pip install duecredit; fi
37+
- rm -r /home/travis/miniconda/lib/python${TRAVIS_PYTHON_VERSION}/site-packages/nipype*
38+
- pip install -r requirements.txt
5839
- pip install -e .
40+
- export COVERAGE_PROCESS_START=$(pwd)/.coveragerc
41+
- export COVERAGE_DATA_FILE=$(pwd)/.coverage
42+
- echo "data_file = ${COVERAGE_DATA_FILE}" >> ${COVERAGE_PROCESS_START}
5943
script:
60-
- python -W once:FSL:UserWarning:nipype `which nosetests` --with-doctest --with-cov --cover-package nipype --cov-config .coveragerc --logging-level=DEBUG --verbosity=3
44+
- python -W once:FSL:UserWarning:nipype `which nosetests` --with-doctest --with-doctest-ignore-unicode --with-cov --cover-package nipype --logging-level=DEBUG --verbosity=3
6145
after_success:
62-
- coveralls --config_file .coveragerc
46+
- coveralls --config_file ${COVERAGE_PROCESS_START}
6347
deploy:
6448
provider: pypi
6549
user: satra

CHANGES

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
Upcoming release 0.13
22
=====================
33

4+
* FIX: Use builtins open and unicode literals for py3 compatibility (https://github.com/nipy/nipype/pull/1572)
5+
* TST: reduce the size of docker images & use tags for images (https://github.com/nipy/nipype/pull/1564)
6+
* ENH: Implement missing inputs/outputs in FSL AvScale (https://github.com/nipy/nipype/pull/1563)
7+
* FIX: Fix symlink test in copyfile (https://github.com/nipy/nipype/pull/1570, https://github.com/nipy/nipype/pull/1586)
8+
* ENH: Added support for custom job submission check in SLURM (https://github.com/nipy/nipype/pull/1582)
9+
10+
11+
Release 0.12.1 (August 3, 2016)
12+
===============================
13+
14+
* FIX: runtime profiling is optional and off by default (https://github.com/nipy/nipype/pull/1561)
15+
* TST: circle CI tests run with docker (https://github.com/nipy/nipype/pull/1541)
16+
* FIX: workflow export functions without import error (https://github.com/nipy/nipype/pull/1552)
17+
418

519
Release 0.12.0 (July 12, 2016)
620
==============================

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,24 @@ clean-ctags:
4646
clean-doc:
4747
rm -rf doc/_build
4848

49-
clean: clean-build clean-pyc clean-so clean-ctags clean-doc
49+
clean-tests:
50+
rm -f .coverage
51+
52+
clean: clean-build clean-pyc clean-so clean-ctags clean-doc clean-tests
5053

5154
in: inplace # just a shortcut
5255
inplace:
5356
$(PYTHON) setup.py build_ext -i
5457

5558
test-code: in
56-
$(NOSETESTS) -s nipype --with-doctest
59+
$(NOSETESTS) -s nipype --with-doctest --with-doctest-ignore-unicode
5760

5861
test-doc:
59-
$(NOSETESTS) -s --with-doctest --doctest-tests --doctest-extension=rst \
62+
$(NOSETESTS) -s --with-doctest --with-doctest-ignore-unicode --doctest-tests --doctest-extension=rst \
6063
--doctest-fixtures=_fixture doc/
6164

62-
test-coverage:
63-
$(NOSETESTS) -s --with-doctest --with-coverage --cover-package=nipype \
65+
test-coverage: clean-tests in
66+
$(NOSETESTS) -s --with-doctest --with-doctest-ignore-unicode --with-coverage --cover-package=nipype \
6467
--config=.coveragerc
6568

6669
test: clean test-code

bin/nipype_crash_search

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
#!/usr/bin/env python
1+
#!python
22
"""Search for tracebacks inside a folder of nipype crash
33
log files that match a given regular expression.
44
55
Examples:
66
nipype_crash_search -d nipype/wd/log -r '.*subject123.*'
77
"""
88
import re
9+
import sys
910
import os.path as op
1011
from glob import glob
1112

@@ -60,6 +61,7 @@ def display_crash_search(logdir, regex):
6061

6162
if __name__ == "__main__":
6263
from argparse import ArgumentParser, RawTextHelpFormatter
64+
6365
defstr = ' (default %(default)s)'
6466
parser = ArgumentParser(prog='nipype_crash_search',
6567
description=__doc__,
@@ -71,6 +73,10 @@ if __name__ == "__main__":
7173
default='*',
7274
help='Regular expression to be searched in each traceback.' + defstr)
7375

74-
args = parser.parse_args()
76+
if len(sys.argv) == 1:
77+
parser.print_help()
78+
exit(0)
7579

80+
args = parser.parse_args()
7681
display_crash_search(args.logdir, args.regex)
82+
exit(0)

bin/nipype_display_pklz

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!python
2+
"""Prints the content of any .pklz file in your working directory.
3+
4+
Examples:
5+
6+
nipype_print_pklz _inputs.pklz
7+
nipype_print_pklz _node.pklz
8+
"""
9+
10+
def pprint_pklz_file(pklz_file):
11+
""" Print the content of the pklz_file. """
12+
from pprint import pprint
13+
from nipype.utils.filemanip import loadpkl
14+
15+
pkl_data = loadpkl(pklz_file)
16+
pprint(pkl_data)
17+
18+
19+
if __name__ == "__main__":
20+
21+
import sys
22+
from argparse import ArgumentParser, RawTextHelpFormatter
23+
24+
defstr = ' (default %(default)s)'
25+
parser = ArgumentParser(prog='nipype_print_pklz',
26+
description=__doc__,
27+
formatter_class=RawTextHelpFormatter)
28+
parser.add_argument('pklzfile', metavar='f', type=str,
29+
help='pklz file to display')
30+
31+
if len(sys.argv) == 1:
32+
parser.print_help()
33+
exit(0)
34+
35+
args = parser.parse_args()
36+
pprint_pklz_file(args.pklzfile)

build_docs.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*- coding: utf-8 -*-
12
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
23
# vi: set ft=python sts=4 ts=4 sw=4 et:
34
"""
@@ -7,8 +8,8 @@
78
89
python setup.py build_sphinx
910
"""
10-
11-
from __future__ import print_function
11+
from __future__ import print_function, division, unicode_literals, absolute_import
12+
from builtins import open, str
1213

1314
# Standard library imports
1415
import sys
@@ -22,7 +23,7 @@
2223

2324
_info_fname = pjoin(os.path.dirname(__file__), 'nipype', 'info.py')
2425
INFO_VARS = {}
25-
exec(open(_info_fname, 'rt').read(), {}, INFO_VARS)
26+
exec(str(open(_info_fname, 'rt').read()), {}, INFO_VARS)
2627

2728
DOC_BUILD_DIR = os.path.join('doc', '_build', 'html')
2829
DOC_DOCTREES_DIR = os.path.join('doc', '_build', 'doctrees')

circle.yml

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,58 @@ machine:
55
dependencies:
66
cache_directories:
77
- "~/docker"
8+
- "~/examples"
9+
- "~/.apt-cache"
810

911
pre:
10-
- mkdir -p "~/scratch/nose"
12+
# Let CircleCI cache the apt archive
13+
- mkdir -p ~/.apt-cache/partial && sudo rm -rf /var/cache/apt/archives && sudo ln -s ~/.apt-cache /var/cache/apt/archives
14+
- sudo apt-get -y update && sudo apt-get install -y wget bzip2
1115

1216
override:
17+
- mkdir -p ~/examples ~/scratch/nose ~/scratch/logs
18+
- if [[ ! -d ~/examples/nipype-tutorial ]]; then wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q -O nipype-tutorial.tar.bz2 https://dl.dropbox.com/s/jzgq2nupxyz36bp/nipype-tutorial.tar.bz2 && tar xjf nipype-tutorial.tar.bz2 -C ~/examples/; fi
19+
- if [[ ! -d ~/examples/nipype-fsl_course_data ]]; then wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q https://3552243d5be815c1b09152da6525cb8fe7b900a6.googledrive.com/host/0BxI12kyv2olZVUswazA3NkFvOXM/nipype-fsl_course_data.tar.gz && tar xzf nipype-fsl_course_data.tar.gz -C ~/examples/; fi
20+
- if [[ ! -d ~/examples/feeds ]]; then wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q https://3552243d5be815c1b09152da6525cb8fe7b900a6.googledrive.com/host/0BxI12kyv2olZVUswazA3NkFvOXM/fsl-5.0.9-feeds.tar.gz && tar xzf fsl-5.0.9-feeds.tar.gz -C ~/examples/; fi
1321
- if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi
14-
- docker build -t nipype/testbench:latest . :
22+
- docker build -f docker/nipype_test/Dockerfile_py35 -t nipype/nipype_test:py35 . :
1523
timeout: 1600
16-
- mkdir -p ~/docker; docker save nipype/testbench:latest > ~/docker/image.tar :
24+
- docker build -f docker/nipype_test/Dockerfile_py27 -t nipype/nipype_test:py27 . :
1725
timeout: 1600
26+
- mkdir -p ~/docker; docker save nipype/nipype_test:py27 > ~/docker/image.tar :
27+
timeout: 1600
28+
- pip install xunitmerge
1829

1930
test:
2031
override:
21-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch --entrypoint="/usr/bin/run_builddocs.sh" nipype/testbench
22-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch nipype/testbench test_spm Linear /root/examples/ workflow3d :
32+
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /root/src/nipype/doc nipype/nipype_test:py35 /usr/bin/run_builddocs.sh
33+
- docker run -v /etc/localtime:/etc/localtime:ro -e FSL_COURSE_DATA="/root/examples/nipype-fsl_course_data" -v ~/examples:/root/examples:ro -v ~/scratch:/scratch -w /root/src/nipype nipype/nipype_test:py35 /usr/bin/run_nosetests.sh py35 :
34+
timeout: 2600
35+
- docker run -v /etc/localtime:/etc/localtime:ro -e FSL_COURSE_DATA="/root/examples/nipype-fsl_course_data" -v ~/examples:/root/examples:ro -v ~/scratch:/scratch -w /root/src/nipype nipype/nipype_test:py27 /usr/bin/run_nosetests.sh py27 :
36+
timeout: 2600
37+
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v ~/scratch:/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh test_spm Linear /root/examples/ workflow3d :
2338
timeout: 1600
24-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch nipype/testbench test_spm Linear /root/examples/ workflow4d :
39+
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v ~/scratch:/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh test_spm Linear /root/examples/ workflow4d :
2540
timeout: 1600
26-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch nipype/testbench fmri_fsl_feeds Linear /root/examples/ l1pipeline
27-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch nipype/testbench fmri_spm_dartel Linear /root/examples/ level1 :
41+
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v ~/scratch:/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_fsl_feeds Linear /root/examples/ l1pipeline
42+
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v ~/scratch:/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_spm_dartel Linear /root/examples/ level1 :
2843
timeout: 1600
29-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch nipype/testbench fmri_spm_dartel Linear /root/examples/ l2pipeline :
44+
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v ~/scratch:/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_spm_dartel Linear /root/examples/ l2pipeline :
3045
timeout: 1600
31-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch nipype/testbench fmri_fsl_reuse Linear /root/examples/ level1_workflow
32-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch nipype/testbench fmri_spm_nested Linear /root/examples/ level1
33-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch nipype/testbench fmri_spm_nested Linear /root/examples/ l2pipeline
34-
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/scratch:/scratch -w /scratch --entrypoint="/usr/bin/run_nosetests.sh" nipype/testbench :
35-
timeout: 2600
46+
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v ~/scratch:/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_fsl_reuse Linear /root/examples/ level1_workflow
47+
- docker run -v /etc/localtime:/etc/localtime:ro -e NIPYPE_NUMBER_OF_CPUS=4 -v ~/examples:/root/examples:ro -v ~/scratch:/scratch -w /scratch nipype/nipype_test:py27 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /root/examples/ level1
48+
- docker run -v /etc/localtime:/etc/localtime:ro -e NIPYPE_NUMBER_OF_CPUS=4 -v ~/examples:/root/examples:ro -v ~/scratch:/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /root/examples/ level1
49+
- docker run -v /etc/localtime:/etc/localtime:ro -e NIPYPE_NUMBER_OF_CPUS=4 -v ~/examples:/root/examples:ro -v ~/scratch:/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /root/examples/ l2pipeline
50+
3651
post:
3752
- bash docker/circleci/teardown.sh
3853

3954
general:
4055
artifacts:
4156
- "~/docs"
4257
- "~/logs"
43-
- "~/coverage.xml"
44-
- "~/nosetests.xml"
45-
- "~/builddocs.log"
58+
- "~/coverage_py27.xml"
59+
- "~/coverage_py35.xml"
60+
- "~/nosetests_py27.xml"
61+
- "~/nosetests_py35.xml"
4662
- "~/scratch"

doc/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ htmlonly:
3535

3636
api:
3737
rm -rf api/generated
38-
python ../tools/build_modref_templates.py
38+
python -u ../tools/build_modref_templates.py
3939
rm -rf interfaces/generated
40-
python ../tools/build_interface_docs.py
40+
python -u ../tools/build_interface_docs.py
4141
@echo "Build API docs finished."
4242

4343
html: clean examples2rst api htmlonly
@@ -76,7 +76,7 @@ doctest:
7676
"results in _build/doctest/output.txt."
7777

7878
gitwash-update:
79-
python ../tools/gitwash_dumper.py devel nipype \
79+
python -u ../tools/gitwash_dumper.py devel nipype \
8080
--repo-name=nipype \
8181
--github-user=nipy \
8282
--project-url=http://nipy.org/nipype \

doc/devel/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ conventions documented in the `NIPY Developers Guide
1919
architecture
2020
provenance
2121
software_using_nipype
22+
testing_nipype
2223

2324

2425
.. include:: ../links_names.txt

0 commit comments

Comments
 (0)