Skip to content

Commit dd083a9

Browse files
committed
Merge branch 'master' of git://github.com/nipy/nipype into fix/lgtm
2 parents 8585d51 + 88dbce1 commit dd083a9

Some content is hidden

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

104 files changed

+265
-742
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ python:
1212
env:
1313
- INSTALL_DEB_DEPENDECIES=true NIPYPE_EXTRAS="doc,tests,fmri,profiler" CI_SKIP_TEST=1
1414
- INSTALL_DEB_DEPENDECIES=false NIPYPE_EXTRAS="doc,tests,fmri,profiler" CI_SKIP_TEST=1
15-
- INSTALL_DEB_DEPENDECIES=true NIPYPE_EXTRAS="doc,tests,fmri,profiler,duecredit" CI_SKIP_TEST=1
15+
- INSTALL_DEB_DEPENDECIES=true NIPYPE_EXTRAS="doc,tests,fmri,profiler,duecredit,ssh" CI_SKIP_TEST=1
1616
- INSTALL_DEB_DEPENDECIES=true NIPYPE_EXTRAS="doc,tests,fmri,profiler" PIP_FLAGS="--pre" CI_SKIP_TEST=1
1717

1818
addons:
@@ -40,7 +40,7 @@ before_install:
4040
fi;
4141

4242
# handle python operations separately to reduce timeouts
43-
- wget https://repo.continuum.io/miniconda/Miniconda${TRAVIS_PYTHON_VERSION:0:1}-4.3.31-Linux-x86_64.sh
43+
- wget https://repo.continuum.io/miniconda/Miniconda${TRAVIS_PYTHON_VERSION:0:1}-latest-Linux-x86_64.sh
4444
-O /home/travis/.cache/conda.sh
4545
- bash ${HOME}/.cache/conda.sh -b -p ${HOME}/conda
4646
- export PATH=${HOME}/conda/bin:$PATH

CONTRIBUTING.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ The current list of issue labels are [here][link_labels] and include:
3535
Please try to make sure that your requested enhancement is distinct from any others that have already been requested or implemented.
3636
If you find one that's similar but there are subtle differences, please reference the other request in your issue.
3737

38+
* [![Orphaned](https://img.shields.io/badge/-orphaned-9baddd.svg)][link_orphaned] *These pull requests have been closed for inactivity.*
39+
40+
Before proposing a new pull request, browse through the "orphaned" pull requests.
41+
You may find that someone has already made significant progress toward your goal, and you can re-use their
42+
unfinished work.
43+
An adopted PR should be updated to merge or rebase the current master, and a new PR should be created (see
44+
below) that references the original PR.
45+
3846
## Making a change
3947

4048
We appreciate all contributions to Nipype, but those accepted fastest will follow a workflow similar to the following:
@@ -57,8 +65,9 @@ Make sure to [keep your fork up to date][link_updateupstreamwiki] with the maste
5765
If you're adding a new tool from an existing neuroimaging toolkit (e.g., 3dDeconvolve from AFNI), check out the [guide for adding new interfaces to Nipype][link_new_interfaces].
5866

5967
To confirm that your changes worked as intended, [clone your fork][link_cloning] to create a local directory.
60-
In this local directory, run `python setup.py develop`.
61-
This will add your version of nipype to your local python environment.
68+
In this local directory, run `pip install -e .[dev]`.
69+
This will add your version of nipype to your local python environment and
70+
install dependencies needed for development.
6271

6372
Then, in this local nipype directory, run `make check-before-commit`. If you get no errors, you're ready to submit your changes!
6473

@@ -131,6 +140,7 @@ You're awesome. :wave::smiley:
131140
[link_helpwanted]: https://github.com/nipy/nipype/labels/help-wanted
132141
[link_good_first_issue]: https://github.com/nipy/nipype/issues?q=is%3Aopen+is%3Aissue+label%3Agood-first-issue
133142
[link_enhancement]: https://github.com/nipy/nipype/labels/enhancement
143+
[link_orphaned]: https://github.com/nipy/nipype/pulls?q=is%3Apr+label%3Aorphaned+is%3Aclosed
134144

135145
[link_pullrequest]: https://help.github.com/articles/creating-a-pull-request/
136146
[link_fork]: https://help.github.com/articles/fork-a-repo/

docker/generate_dockerfiles.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ done
5454

5555

5656
# neurodocker version 0.3.1-22-gb0ee069
57-
NEURODOCKER_IMAGE="kaczmarj/neurodocker@sha256:c670ec2e0666a63d4e017a73780f66554283e294f3b12250928ee74b8a48bc59"
57+
NEURODOCKER_IMAGE="kaczmarj/neurodocker@sha256:f15ca90803f4b89acfca55cd1c7269bf2ec2dfd95b3de1118b08afa34b87d9d1"
5858

5959
# neurodebian:stretch-non-free pulled on November 3, 2017
6060
BASE_IMAGE="neurodebian@sha256:7590552afd0e7a481a33314724ae27f76ccedd05ffd7ac06ec38638872427b9b"
@@ -88,7 +88,6 @@ function generate_main_dockerfile() {
8888
--user neuro \
8989
--miniconda env_name=neuro \
9090
activate=true \
91-
miniconda_version=4.3.31 \
9291
--copy docker/files/run_builddocs.sh docker/files/run_examples.sh \
9392
docker/files/run_pytests.sh nipype/external/fsl_imglob.py /usr/bin/ \
9493
--copy . /src/nipype \
@@ -103,7 +102,7 @@ function generate_main_dockerfile() {
103102
--arg PYTHON_VERSION_MAJOR=3 PYTHON_VERSION_MINOR=6 BUILD_DATE VCS_REF VERSION \
104103
--miniconda env_name=neuro \
105104
conda_install='python=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}
106-
icu=58.1 libxml2 libxslt matplotlib mkl numpy
105+
icu=58.1 libxml2 libxslt matplotlib mkl numpy paramiko
107106
pandas psutil scikit-learn scipy traits=4.6.0' \
108107
pip_opts="-e" \
109108
pip_install="/src/nipype[all]" \

nipype/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@
2525

2626

2727
class NipypeTester(object):
28-
def __call__(self, doctests=True):
28+
def __call__(self, doctests=True, parallel=True):
2929
try:
3030
import pytest
3131
except:
3232
raise RuntimeError(
3333
'py.test not installed, run: pip install pytest')
34-
params = {'args': []}
35-
if doctests:
36-
params['args'].append('--doctest-modules')
37-
nipype_path = os.path.dirname(__file__)
38-
params['args'].extend(
39-
['-x', '--ignore={}/external'.format(nipype_path), nipype_path])
40-
pytest.main(**params)
34+
args = []
35+
if not doctests:
36+
args.extend(['-p', 'no:doctest'])
37+
if not parallel:
38+
args.append('-n0')
39+
args.append(os.path.dirname(__file__))
40+
pytest.main(args=args)
4141

4242

4343
test = NipypeTester()

nipype/algorithms/confounds.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@
33
# vi: set ft=python sts=4 ts=4 sw=4 et:
44
'''
55
Algorithms to compute confounds in :abbr:`fMRI (functional MRI)`
6-
7-
Change directory to provide relative paths for doctests
8-
>>> import os
9-
>>> filepath = os.path.dirname(os.path.realpath(__file__))
10-
>>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data'))
11-
>>> os.chdir(datadir)
12-
136
'''
147
from __future__ import (print_function, division, unicode_literals,
158
absolute_import)

nipype/algorithms/mesh.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
# vi: set ft=python sts=4 ts=4 sw=4 et:
44
"""
55
Miscellaneous algorithms for 2D contours and 3D triangularized meshes handling
6-
7-
.. testsetup::
8-
# Change directory to provide relative paths for doctests
9-
>>> import os
10-
>>> filepath = os.path.dirname(os.path.realpath( __file__ ))
11-
>>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data'))
12-
>>> os.chdir(datadir)
13-
146
"""
157
from __future__ import (print_function, division, unicode_literals,
168
absolute_import)

nipype/algorithms/metrics.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@
44
'''
55
Image assessment algorithms. Typical overlap and error computation
66
measures to evaluate results from other processing units.
7-
8-
Change directory to provide relative paths for doctests
9-
>>> import os
10-
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
11-
>>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data'))
12-
>>> os.chdir(datadir)
13-
147
'''
158
from __future__ import (print_function, division, unicode_literals,
169
absolute_import)

nipype/algorithms/misc.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@
33
# vi: set ft=python sts=4 ts=4 sw=4 et:
44
'''
55
Miscellaneous algorithms
6-
7-
Change directory to provide relative paths for doctests
8-
>>> import os
9-
>>> filepath = os.path.dirname(os.path.realpath(__file__))
10-
>>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data'))
11-
>>> os.chdir(datadir)
12-
136
'''
147
from __future__ import (print_function, division, unicode_literals,
158
absolute_import)

nipype/algorithms/modelgen.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@
1010
These functions include:
1111
1212
* SpecifyModel: allows specification of sparse and non-sparse models
13-
14-
Change directory to provide relative paths for doctests
15-
>>> import os
16-
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
17-
>>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data'))
18-
>>> os.chdir(datadir)
19-
2013
"""
2114
from __future__ import (print_function, division, unicode_literals,
2215
absolute_import)

nipype/algorithms/rapidart.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
1212
* StimulusCorrelation: determines correlation between stimuli
1313
schedule and movement/intensity parameters
14-
15-
Change directory to provide relative paths for doctests
16-
>>> import os
17-
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
18-
>>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data'))
19-
>>> os.chdir(datadir)
2014
"""
2115
from __future__ import (print_function, division, unicode_literals,
2216
absolute_import)

nipype/caching/memory.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
"""
33
Using nipype with persistence and lazy recomputation but without explicit
44
name-steps pipeline: getting back scope in command-line based programming.
5-
6-
Change directory to provide relative paths for doctests
7-
>>> import os
8-
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
9-
>>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data'))
10-
>>> os.chdir(datadir)
115
"""
126
from __future__ import (print_function, division, unicode_literals,
137
absolute_import)

nipype/conftest.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22
import numpy
33
import os
44

5+
DATADIR = os.path.realpath(
6+
os.path.join(os.path.dirname(__file__), 'testing/data'))
7+
58

69
@pytest.fixture(autouse=True)
710
def add_np(doctest_namespace):
811
doctest_namespace['np'] = numpy
912
doctest_namespace['os'] = os
1013

11-
filepath = os.path.dirname(os.path.realpath(__file__))
12-
datadir = os.path.realpath(os.path.join(filepath, 'testing/data'))
13-
doctest_namespace["datadir"] = datadir
14+
doctest_namespace["datadir"] = DATADIR
15+
16+
17+
@pytest.fixture(autouse=True)
18+
def in_testing(request):
19+
# This seems to be a reliable way to distinguish tests from doctests
20+
if request.function is None:
21+
os.chdir(DATADIR)

nipype/info.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def get_nipype_gitversion():
152152
if sys.version_info <= (3, 4):
153153
REQUIRES.append('configparser')
154154

155-
TESTS_REQUIRES = ['pytest-cov', 'codecov']
155+
TESTS_REQUIRES = ['pytest-cov', 'codecov', 'pytest-xdist', 'pytest-env']
156156

157157
EXTRA_REQUIRES = {
158158
'doc': ['Sphinx>=1.4', 'numpydoc', 'matplotlib', 'pydotplus', 'pydot>=1.2.3'],
@@ -162,11 +162,20 @@ def get_nipype_gitversion():
162162
'profiler': ['psutil>=5.0'],
163163
'duecredit': ['duecredit'],
164164
'xvfbwrapper': ['xvfbwrapper'],
165-
'pybids': ['pybids']
165+
'pybids': ['pybids'],
166+
'ssh': ['paramiko'],
166167
# 'mesh': ['mayavi'] # Enable when it works
167168
}
168169

170+
171+
def _list_union(iterable):
172+
return list(set(sum(iterable, [])))
173+
174+
169175
# Enable a handle to install all extra dependencies at once
170-
EXTRA_REQUIRES['all'] = [val for _, val in list(EXTRA_REQUIRES.items())]
176+
EXTRA_REQUIRES['all'] = _list_union(EXTRA_REQUIRES.values())
177+
# dev = doc + tests + specs
178+
EXTRA_REQUIRES['dev'] = _list_union(val for key, val in EXTRA_REQUIRES.items()
179+
if key in ('doc', 'tests', 'specs'))
171180

172181
STATUS = 'stable'

nipype/interfaces/afni/model.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
Examples
77
--------
88
See the docstrings of the individual classes for examples.
9-
.. testsetup::
10-
# Change directory to provide relative paths for doctests
11-
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
12-
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
13-
>>> os.chdir(datadir)
149
"""
1510
from __future__ import (print_function, division, unicode_literals,
1611
absolute_import)

nipype/interfaces/afni/preprocess.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
33
# vi: set ft=python sts=4 ts=4 sw=4 et:
44
"""AFNI preprocessing interfaces
5-
6-
Change directory to provide relative paths for doctests
7-
>>> import os
8-
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
9-
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
10-
>>> os.chdir(datadir)
115
"""
126
from __future__ import (print_function, division, unicode_literals,
137
absolute_import)

nipype/interfaces/afni/svm.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
33
# vi: set ft = python sts = 4 ts = 4 sw = 4 et:
44
"""Afni svm interfaces
5-
6-
Change directory to provide relative paths for doctests
7-
>>> import os
8-
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
9-
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
10-
>>> os.chdir(datadir)
115
"""
126
from __future__ import (print_function, division, unicode_literals,
137
absolute_import)

nipype/interfaces/afni/utils.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
Examples
77
--------
88
See the docstrings of the individual classes for examples.
9-
.. testsetup::
10-
# Change directory to provide relative paths for doctests
11-
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
12-
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
13-
>>> os.chdir(datadir)
149
"""
1510
from __future__ import (print_function, division, unicode_literals,
1611
absolute_import)

nipype/interfaces/ants/legacy.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
# of the antsApplyTransform program. This implementation is here
55
# for backwards compatibility.
66
"""ANTS Apply Transforms interface
7-
8-
Change directory to provide relative paths for doctests
9-
>>> import os
10-
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
11-
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
12-
>>> os.chdir(datadir)
137
"""
148

159
from builtins import range

nipype/interfaces/ants/registration.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""The ants module provides basic functions for interfacing with ants
33
functions.
4-
5-
Change directory to provide relative paths for doctests
6-
>>> import os
7-
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
8-
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
9-
>>> os.chdir(datadir)
104
"""
115
from __future__ import (print_function, division, unicode_literals,
126
absolute_import)

nipype/interfaces/ants/resampling.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""ANTS Apply Transforms interface
3-
4-
Change directory to provide relative paths for doctests
5-
>>> import os
6-
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
7-
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
8-
>>> os.chdir(datadir)
93
"""
104
from __future__ import (print_function, division, unicode_literals,
115
absolute_import)

nipype/interfaces/ants/segmentation.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""The ants module provides basic functions for interfacing with ants functions.
3-
4-
Change directory to provide relative paths for doctests
5-
>>> import os
6-
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
7-
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
8-
>>> os.chdir(datadir)
9-
103
"""
114
from __future__ import (print_function, division, unicode_literals,
125
absolute_import)

nipype/interfaces/ants/utils.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""ANTS Apply Transforms interface
3-
4-
Change directory to provide relative paths for doctests
5-
>>> import os
6-
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
7-
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
8-
>>> os.chdir(datadir)
93
"""
104
from __future__ import (print_function, division, unicode_literals,
115
absolute_import)

nipype/interfaces/ants/visualization.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""The ants visualisation module provides basic functions based on ITK.
3-
Change directory to provide relative paths for doctests
4-
>>> import os
5-
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
6-
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
7-
>>> os.chdir(datadir)
83
"""
94
from __future__ import (print_function, division, unicode_literals,
105
absolute_import)

nipype/interfaces/bru2nii.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""The bru2nii module provides basic functions for dicom conversion
3-
4-
Change directory to provide relative paths for doctests
5-
>>> import os
6-
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
7-
>>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data'))
8-
>>> os.chdir(datadir)
93
"""
104
from __future__ import (print_function, division, unicode_literals,
115
absolute_import)

0 commit comments

Comments
 (0)