Skip to content

Commit b20ac23

Browse files
committed
Merge branch 'master' of git://github.com/nipy/nipype into fix/art
2 parents 1301873 + 2b10ff2 commit b20ac23

File tree

745 files changed

+5371
-3107
lines changed

Some content is hidden

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

745 files changed

+5371
-3107
lines changed

.circle/tests.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ fi
1717
# They may need to be rebalanced in the future.
1818
case ${CIRCLE_NODE_INDEX} in
1919
0)
20-
docker run --rm=false -it -e FSL_COURSE_DATA="/data/examples/nipype-fsl_course_data" -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py36 /usr/bin/run_pytests.sh && \
21-
docker run --rm=false -it -e FSL_COURSE_DATA="/data/examples/nipype-fsl_course_data" -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py27 /usr/bin/run_pytests.sh && \
20+
docker run --rm=false -it -e CI_SKIP_TEST=1 -e NIPYPE_RESOURCE_MONITOR=1 -e FSL_COURSE_DATA="/data/examples/nipype-fsl_course_data" -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py36 /usr/bin/run_pytests.sh && \
21+
docker run --rm=false -it -e CI_SKIP_TEST=1 -e NIPYPE_RESOURCE_MONITOR=1 -e FSL_COURSE_DATA="/data/examples/nipype-fsl_course_data" -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py27 /usr/bin/run_pytests.sh && \
2222
docker run --rm=false -it -v $WORKDIR:/work -w /src/nipype/doc --entrypoint=/usr/bin/run_builddocs.sh nipype/nipype:py36 /usr/bin/run_builddocs.sh && \
2323
docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py36 /usr/bin/run_examples.sh test_spm Linear /data/examples/ workflow3d && \
2424
docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py36 /usr/bin/run_examples.sh test_spm Linear /data/examples/ workflow4d
@@ -30,8 +30,8 @@ case ${CIRCLE_NODE_INDEX} in
3030
exitcode=$?
3131
;;
3232
2)
33-
docker run --rm=false -it -e NIPYPE_NUMBER_OF_CPUS=4 -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py27 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /data/examples/ level1 && \
34-
docker run --rm=false -it -e NIPYPE_NUMBER_OF_CPUS=4 -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py36 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /data/examples/ l2pipeline
33+
docker run --rm=false -it -e NIPYPE_NUMBER_OF_CPUS=4 -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py36 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /data/examples/ level1 && \
34+
docker run --rm=false -it -e NIPYPE_NUMBER_OF_CPUS=4 -e NIPYPE_RESOURCE_MONITOR=1 -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py27 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /data/examples/ l2pipeline
3535
exitcode=$?
3636
;;
3737
3)

.travis.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ python:
88
- 3.5
99
- 3.6
1010
env:
11-
- INSTALL_DEB_DEPENDECIES=true NIPYPE_EXTRAS="doc,tests,fmri,profiler"
12-
- INSTALL_DEB_DEPENDECIES=false NIPYPE_EXTRAS="doc,tests,fmri,profiler"
13-
- INSTALL_DEB_DEPENDECIES=true NIPYPE_EXTRAS="doc,tests,fmri,profiler,duecredit"
11+
- INSTALL_DEB_DEPENDECIES=true NIPYPE_EXTRAS="doc,tests,fmri,profiler" CI_SKIP_TEST=1
12+
- INSTALL_DEB_DEPENDECIES=false NIPYPE_EXTRAS="doc,tests,fmri,profiler" CI_SKIP_TEST=1
13+
- INSTALL_DEB_DEPENDECIES=true NIPYPE_EXTRAS="doc,tests,fmri,profiler,duecredit" CI_SKIP_TEST=1
14+
- INSTALL_DEB_DEPENDECIES=true NIPYPE_EXTRAS="doc,tests,fmri,profiler" PIP_FLAGS="--pre" CI_SKIP_TEST=1
1415
before_install:
1516
- function apt_inst {
1617
if $INSTALL_DEB_DEPENDECIES; then sudo rm -rf /dev/shm; fi &&
@@ -36,12 +37,17 @@ before_install:
3637
conda install python=${TRAVIS_PYTHON_VERSION} &&
3738
conda config --add channels conda-forge &&
3839
conda install -y nipype icu &&
39-
rm -r ${CONDA_HOME}/lib/python${TRAVIS_PYTHON_VERSION}/site-packages/nipype*; }
40+
rm -r ${CONDA_HOME}/lib/python${TRAVIS_PYTHON_VERSION}/site-packages/nipype*;
41+
pushd $HOME;
42+
git clone https://github.com/INCF/pybids.git;
43+
cd pybids;
44+
pip install -e .;
45+
popd; }
4046
# Add install of vtk and mayavi to test mesh (disabled): conda install -y vtk mayavi
4147
- travis_retry apt_inst
4248
- travis_retry conda_inst
4349
install:
44-
- travis_retry pip install -e .[$NIPYPE_EXTRAS]
50+
- travis_retry pip install $PIP_FLAGS -e .[$NIPYPE_EXTRAS]
4551
script:
4652
- py.test -v --doctest-modules nipype
4753
deploy:

.zenodo.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,16 @@
523523
"affiliation": "University of Amsterdam",
524524
"name": "Lukas Snoek",
525525
"orcid": "0000-0001-8972-204X"
526+
},
527+
{
528+
"affiliation": "Vrije Universiteit, Amsterdam",
529+
"name": "Gilles de Hollander",
530+
"orcid": "0000-0003-1988-5091"
531+
},
532+
{
533+
"affiliation": "University of Texas at Austin",
534+
"name": "De La Vega, Alejandro",
535+
"orcid": "0000-0001-9062-3778"
526536
}
527537
],
528538
"keywords": [

CHANGES

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

4+
* ENH: Improve terminal_output feature (https://github.com/nipy/nipype/pull/2209)
5+
* ENH: Simple interface to FSL std2imgcoords (https://github.com/nipy/nipype/pull/2209, prev #1398)
6+
* ENH: Centralize virtual/physical $DISPLAYs (https://github.com/nipy/nipype/pull/#2203)
7+
* ENH: New ResourceMonitor - replaces resource profiler (https://github.com/nipy/nipype/pull/#2200)
48

59
0.13.1 (May 20, 2017)
610
=====================

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ COPY requirements.txt requirements.txt
8787
RUN pip install -r requirements.txt && \
8888
rm -rf ~/.cache/pip
8989

90+
RUN git clone https://github.com/INCF/pybids.git && \
91+
cd pybids && python setup.py develop
92+
9093
# Installing nipype
9194
COPY . /src/nipype
9295
RUN cd /src/nipype && \

doc/devel/gitwash/known_projects.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
.. _`PROJECTNAME mailing list`: http://projects.scipy.org/mailman/listinfo/nipy-devel
77

88
.. numpy
9-
.. _numpy: hhttp://numpy.scipy.org
9+
.. _numpy: http://numpy.scipy.org
1010
.. _`numpy github`: http://github.com/numpy/numpy
1111
.. _`numpy mailing list`: http://mail.scipy.org/mailman/listinfo/numpy-discussion
1212

doc/devel/interface_specs.rst

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,70 @@ generated depending on inputs, by the tool. OutputSpecs inherit from
159159
``interfaces.base.TraitedSpec`` directly.
160160

161161

162+
Controlling outputs to terminal
163+
-------------------------------
164+
165+
It is very likely that the software wrapped within the interface writes
166+
to the standard output or the standard error of the terminal.
167+
Interfaces provide a means to access and retrieve these outputs, by
168+
using the ``terminal_output`` attribute: ::
169+
170+
import nipype.interfaces.fsl as fsl
171+
mybet = fsl.BET(from_file='bet-settings.json')
172+
mybet.terminal_output = 'file_split'
173+
174+
In the example, the ``terminal_output = 'file_split'`` will redirect the
175+
standard output and the standard error to split files (called
176+
``stdout.nipype`` and ``stderr.nipype`` respectively).
177+
The possible values for ``terminal_output`` are:
178+
179+
*file*
180+
Redirects both standard output and standard error to the same file
181+
called ``output.nipype``.
182+
Messages from both streams will be overlapped as they arrive to
183+
the file.
184+
185+
*file_split*
186+
Redirects the output streams separately, to ``stdout.nipype``
187+
and ``stderr.nipype`` respectively, as described in the example.
188+
189+
*file_stdout*
190+
Only the standard output will be redirected to ``stdout.nipype``
191+
and the standard error will be discarded.
192+
193+
*file_stderr*
194+
Only the standard error will be redirected to ``stderr.nipype``
195+
and the standard output will be discarded.
196+
197+
*stream*
198+
Both output streams are redirected to the current logger printing
199+
their messages interleaved and immediately to the terminal.
200+
201+
*allatonce*
202+
Both output streams will be forwarded to a buffer and stored
203+
separately in the `runtime` object that the `run()` method returns.
204+
No files are written nor streams printed out to terminal.
205+
206+
*none*
207+
Both outputs are discarded
208+
209+
In all cases, except for the ``'none'`` setting of ``terminal_output``,
210+
the ``run()`` method will return a "runtime" object that will contain
211+
the streams in the corresponding properties (``runtime.stdout``
212+
for the standard output, ``runtime.stderr`` for the standard error, and
213+
``runtime.merged`` for both when streams are mixed, eg. when using the
214+
*file* option). ::
215+
216+
import nipype.interfaces.fsl as fsl
217+
mybet = fsl.BET(from_file='bet-settings.json')
218+
mybet.terminal_output = 'file_split'
219+
...
220+
result = mybet.run()
221+
result.runtime.stdout
222+
' ... captured standard output ...'
223+
224+
225+
162226
Traited Attributes
163227
------------------
164228

doc/users/config_file.rst

Lines changed: 80 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -14,93 +14,100 @@ Logging
1414
~~~~~~~
1515

1616
*workflow_level*
17-
How detailed the logs regarding workflow should be (possible values:
18-
``INFO`` and ``DEBUG``; default value: ``INFO``)
19-
*filemanip_level*
20-
How detailed the logs regarding file operations (for example overwriting
21-
warning) should be (possible values: ``INFO`` and ``DEBUG``; default value:
22-
``INFO``)
17+
How detailed the logs regarding workflow should be (possible values:
18+
``INFO`` and ``DEBUG``; default value: ``INFO``)
19+
*utils_level*
20+
How detailed the logs regarding nipype utils, like file operations
21+
(for example overwriting warning) or the resource profiler, should be
22+
(possible values: ``INFO`` and ``DEBUG``; default value:
23+
``INFO``)
2324
*interface_level*
24-
How detailed the logs regarding interface execution should be (possible
25-
values: ``INFO`` and ``DEBUG``; default value: ``INFO``)
25+
How detailed the logs regarding interface execution should be (possible
26+
values: ``INFO`` and ``DEBUG``; default value: ``INFO``)
27+
*filemanip_level* (deprecated as of 1.0)
28+
How detailed the logs regarding file operations (for example overwriting
29+
warning) should be (possible values: ``INFO`` and ``DEBUG``)
2630
*log_to_file*
2731
Indicates whether logging should also send the output to a file (possible
2832
values: ``true`` and ``false``; default value: ``false``)
2933
*log_directory*
30-
Where to store logs. (string, default value: home directory)
34+
Where to store logs. (string, default value: home directory)
3135
*log_size*
32-
Size of a single log file. (integer, default value: 254000)
36+
Size of a single log file. (integer, default value: 254000)
3337
*log_rotate*
34-
How many rotation should the log file make. (integer, default value: 4)
38+
How many rotation should the log file make. (integer, default value: 4)
3539

3640
Execution
3741
~~~~~~~~~
3842

3943
*plugin*
40-
This defines which execution plugin to use. (possible values: ``Linear``,
41-
``MultiProc``, ``SGE``, ``IPython``; default value: ``Linear``)
44+
This defines which execution plugin to use. (possible values: ``Linear``,
45+
``MultiProc``, ``SGE``, ``IPython``; default value: ``Linear``)
4246

4347
*stop_on_first_crash*
44-
Should the workflow stop upon first node crashing or try to execute as many
45-
nodes as possible? (possible values: ``true`` and ``false``; default value:
46-
``false``)
48+
Should the workflow stop upon first node crashing or try to execute as many
49+
nodes as possible? (possible values: ``true`` and ``false``; default value:
50+
``false``)
4751

4852
*stop_on_first_rerun*
49-
Should the workflow stop upon first node trying to recompute (by that we
50-
mean rerunning a node that has been run before - this can happen due changed
51-
inputs and/or hash_method since the last run). (possible values: ``true``
52-
and ``false``; default value: ``false``)
53+
Should the workflow stop upon first node trying to recompute (by that we
54+
mean rerunning a node that has been run before - this can happen due changed
55+
inputs and/or hash_method since the last run). (possible values: ``true``
56+
and ``false``; default value: ``false``)
5357

5458
*hash_method*
55-
Should the input files be checked for changes using their content (slow, but
56-
100% accurate) or just their size and modification date (fast, but
57-
potentially prone to errors)? (possible values: ``content`` and
58-
``timestamp``; default value: ``timestamp``)
59+
Should the input files be checked for changes using their content (slow, but
60+
100% accurate) or just their size and modification date (fast, but
61+
potentially prone to errors)? (possible values: ``content`` and
62+
``timestamp``; default value: ``timestamp``)
5963

6064
*keep_inputs*
6165
Ensures that all inputs that are created in the nodes working directory are
6266
kept after node execution (possible values: ``true`` and ``false``; default
6367
value: ``false``)
6468

6569
*single_thread_matlab*
66-
Should all of the Matlab interfaces (including SPM) use only one thread?
67-
This is useful if you are parallelizing your workflow using MultiProc or
68-
IPython on a single multicore machine. (possible values: ``true`` and
69-
``false``; default value: ``true``)
70+
Should all of the Matlab interfaces (including SPM) use only one thread?
71+
This is useful if you are parallelizing your workflow using MultiProc or
72+
IPython on a single multicore machine. (possible values: ``true`` and
73+
``false``; default value: ``true``)
7074

7175
*display_variable*
72-
What ``DISPLAY`` variable should all command line interfaces be
73-
run with. This is useful if you are using `xnest
74-
<http://www.x.org/archive/X11R7.5/doc/man/man1/Xnest.1.html>`_
75-
or `Xvfb <http://www.x.org/archive/X11R6.8.1/doc/Xvfb.1.html>`_
76-
and you would like to redirect all spawned windows to
77-
it. (possible values: any X server address; default value: not
78-
set)
76+
Override the ``$DISPLAY`` environment variable for interfaces that require
77+
an X server. This option is useful if there is a running X server, but
78+
``$DISPLAY`` was not defined in nipype's environment. For example, if an X
79+
server is listening on the default port of 6000, set ``display_variable = :0``
80+
to enable nipype interfaces to use it. It may also point to displays provided
81+
by VNC, `xnest <http://www.x.org/archive/X11R7.5/doc/man/man1/Xnest.1.html>`_
82+
or `Xvfb <http://www.x.org/archive/X11R6.8.1/doc/Xvfb.1.html>`_.
83+
If neither ``display_variable`` nor the ``$DISPLAY`` environment variable are
84+
set, nipype will try to configure a new virtual server using Xvfb.
85+
(possible values: any X server address; default value: not set)
7986

8087
*remove_unnecessary_outputs*
81-
This will remove any interface outputs not needed by the workflow. If the
82-
required outputs from a node changes, rerunning the workflow will rerun the
83-
node. Outputs of leaf nodes (nodes whose outputs are not connected to any
84-
other nodes) will never be deleted independent of this parameter. (possible
85-
values: ``true`` and ``false``; default value: ``true``)
88+
This will remove any interface outputs not needed by the workflow. If the
89+
required outputs from a node changes, rerunning the workflow will rerun the
90+
node. Outputs of leaf nodes (nodes whose outputs are not connected to any
91+
other nodes) will never be deleted independent of this parameter. (possible
92+
values: ``true`` and ``false``; default value: ``true``)
8693

8794
*try_hard_link_datasink*
88-
When the DataSink is used to produce an orginized output file outside
89-
of nipypes internal cache structure, a file system hard link will be
90-
attempted first. A hard link allow multiple file paths to point to the
91-
same physical storage location on disk if the conditions allow. By
92-
refering to the same physical file on disk (instead of copying files
93-
byte-by-byte) we can avoid unnecessary data duplication. If hard links
94-
are not supported for the source or destination paths specified, then
95-
a standard byte-by-byte copy is used. (possible values: ``true`` and
96-
``false``; default value: ``true``)
95+
When the DataSink is used to produce an orginized output file outside
96+
of nipypes internal cache structure, a file system hard link will be
97+
attempted first. A hard link allow multiple file paths to point to the
98+
same physical storage location on disk if the conditions allow. By
99+
refering to the same physical file on disk (instead of copying files
100+
byte-by-byte) we can avoid unnecessary data duplication. If hard links
101+
are not supported for the source or destination paths specified, then
102+
a standard byte-by-byte copy is used. (possible values: ``true`` and
103+
``false``; default value: ``true``)
97104

98105
*use_relative_paths*
99-
Should the paths stored in results (and used to look for inputs)
100-
be relative or absolute. Relative paths allow moving the whole
101-
working directory around but may cause problems with
102-
symlinks. (possible values: ``true`` and ``false``; default
103-
value: ``false``)
106+
Should the paths stored in results (and used to look for inputs)
107+
be relative or absolute. Relative paths allow moving the whole
108+
working directory around but may cause problems with
109+
symlinks. (possible values: ``true`` and ``false``; default
110+
value: ``false``)
104111

105112
*local_hash_check*
106113
Perform the hash check on the job submission machine. This option minimizes
@@ -115,10 +122,10 @@ Execution
115122
done after a job finish is detected. (float in seconds; default value: 5)
116123

117124
*remove_node_directories (EXPERIMENTAL)*
118-
Removes directories whose outputs have already been used
119-
up. Doesn't work with IdentiInterface or any node that patches
120-
data through (without copying) (possible values: ``true`` and
121-
``false``; default value: ``false``)
125+
Removes directories whose outputs have already been used
126+
up. Doesn't work with IdentiInterface or any node that patches
127+
data through (without copying) (possible values: ``true`` and
128+
``false``; default value: ``false``)
122129

123130
*stop_on_unknown_version*
124131
If this is set to True, an underlying interface will raise an error, when no
@@ -146,18 +153,27 @@ Execution
146153
crashfiles allow portability across machines and shorter load time.
147154
(possible values: ``pklz`` and ``txt``; default value: ``pklz``)
148155

156+
*resource_monitor*
157+
Enables monitoring the resources occupation (possible values: ``true`` and
158+
``false``; default value: ``false``)
159+
160+
*resource_monitor_frequency*
161+
Sampling period (in seconds) between measurements of resources (memory, cpus)
162+
being used by an interface. Requires ``resource_monitor`` to be ``true``.
163+
(default value: ``1``)
164+
149165
Example
150166
~~~~~~~
151167

152168
::
153169

154-
[logging]
155-
workflow_level = DEBUG
170+
[logging]
171+
workflow_level = DEBUG
156172

157-
[execution]
158-
stop_on_first_crash = true
159-
hash_method = timestamp
160-
display_variable = :1
173+
[execution]
174+
stop_on_first_crash = true
175+
hash_method = timestamp
176+
display_variable = :1
161177

162178
Workflow.config property has a form of a nested dictionary reflecting the
163179
structure of the .cfg file.

doc/users/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use the following command::
4747
While `all` installs everything, one can also install select components as
4848
listed below::
4949

50-
'doc': ['Sphinx>=1.4', 'matplotlib', 'pydotplus'],
50+
'doc': ['Sphinx>=1.4', 'matplotlib', 'pydotplus', 'pydot>=1.2.3'],
5151
'tests': ['pytest-cov', 'codecov'],
5252
'nipy': ['nitime', 'nilearn', 'dipy', 'nipy', 'matplotlib'],
5353
'profiler': ['psutil'],

doc/users/interface_tutorial.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Specifying input settings
1010
The nipype interface modules provide a Python interface to external
1111
packages like FSL_ and SPM_. Within the module are a series of Python
1212
classes which wrap specific package functionality. For example, in
13-
the fsl module, the class :class:`nipype.interfaces.fsl.Bet` wraps the
13+
the fsl module, the class :class:`nipype.interfaces.fsl.BET` wraps the
1414
``bet`` command-line tool. Using the command-line tool, one would
1515
specify input settings using flags like ``-o``, ``-m``, ``-f <f>``, etc...
1616
However, in nipype, options are assigned to Python attributes and can

0 commit comments

Comments
 (0)