Skip to content

update tests to py36, clean up documentation towards release #1977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .circle/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ fi
# They may need to be rebalanced in the future.
case ${CIRCLE_NODE_INDEX} in
0)
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:py35 /usr/bin/run_pytests.sh && \
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 && \
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 && \
docker run --rm=false -it -v $WORKDIR:/work -w /src/nipype/doc nipype/nipype:py35 /usr/bin/run_builddocs.sh && \
docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh test_spm Linear /data/examples/ workflow3d && \
docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh test_spm Linear /data/examples/ workflow4d
docker run --rm=false -it -v $WORKDIR:/work -w /src/nipype/doc nipype/nipype:py36 /usr/bin/run_builddocs.sh && \
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 && \
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
;;
1)
docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_spm_dartel Linear /data/examples/ level1 && \
docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_spm_dartel Linear /data/examples/ l2pipeline
docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py36 /usr/bin/run_examples.sh fmri_spm_dartel Linear /data/examples/ level1 && \
docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py36 /usr/bin/run_examples.sh fmri_spm_dartel Linear /data/examples/ l2pipeline
;;
2)
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 && \
docker run --rm=false -it -e NIPYPE_NUMBER_OF_CPUS=4 -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /data/examples/ l2pipeline
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
;;
3)
docker run --rm=false -it -e NIPYPE_NUMBER_OF_CPUS=4 -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /data/examples/ level1 && \
docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_fsl_feeds Linear /data/examples/ l1pipeline && \
docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_fsl_reuse Linear /data/examples/ level1_workflow
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 && \
docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py36 /usr/bin/run_examples.sh fmri_fsl_feeds Linear /data/examples/ l1pipeline && \
docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py36 /usr/bin/run_examples.sh fmri_fsl_reuse Linear /data/examples/ level1_workflow
;;
esac

Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ python:
- 2.7
- 3.4
- 3.5
- 3.6
env:
- INSTALL_DEB_DEPENDECIES=true NIPYPE_EXTRAS="doc,tests,fmri,profiler"
- INSTALL_DEB_DEPENDECIES=false NIPYPE_EXTRAS="doc,tests,fmri,profiler"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ENV PATH=/usr/local/miniconda/bin:$PATH \
# only use one thread - nipype will handle parallelization

# Installing precomputed python packages
ARG PYTHON_VERSION_MINOR=5
ARG PYTHON_VERSION_MINOR=6
RUN conda config --add channels conda-forge; sync && \
conda config --set always_yes yes --set changeps1 no; sync && \
conda install -y python=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} \
Expand Down
4 changes: 2 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ dependencies:
- if [ "$CIRCLE_TAG" != "" ]; then sed -i -E "s/(__version__ = )'[A-Za-z0-9.-]+'/\1'$CIRCLE_TAG'/" nipype/info.py; fi
# - e=1 && for i in {1..5}; do docker build -f docker/base.Dockerfile --rm=false -t nipype/base:latest . && e=0 && break || sleep 15; done && [ "$e" -eq "0" ] :
# timeout: 21600
- e=1 && for i in {1..5}; do docker build --rm=false -t nipype/nipype:latest -t nipype/nipype:py35 --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg VERSION=$CIRCLE_TAG . && e=0 && break || sleep 15; done && [ "$e" -eq "0" ] :
- e=1 && for i in {1..5}; do docker build --rm=false -t nipype/nipype:latest -t nipype/nipype:py36 --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg VERSION=$CIRCLE_TAG . && e=0 && break || sleep 15; done && [ "$e" -eq "0" ] :
timeout: 6000
- e=1 && for i in {1..5}; do docker build --rm=false -t nipype/nipype:py27 --build-arg PYTHON_VERSION_MAJOR=2 --build-arg PYTHON_VERSION_MINOR=7 --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg VERSION=$CIRCLE_TAG-py27 . && e=0 && break || sleep 15; done && [ "$e" -eq "0" ] :
timeout: 6000
- docker save -o $HOME/docker/cache.tar nipype/base:latest nipype/nipype:py35 nipype/nipype:py27 :
- docker save -o $HOME/docker/cache.tar nipype/base:latest nipype/nipype:py36 nipype/nipype:py27 :
timeout: 6000

test:
Expand Down
30 changes: 10 additions & 20 deletions doc/devel/testing_nipype.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,17 @@ Testing Nipype using Docker

As of :code:`nipype-0.13`, Nipype is tested inside Docker containers. First, install the
`Docker Engine <https://docs.docker.com/engine/installation/>`_.
Nipype has one base docker image called nipype/nipype, and several additional test images
Nipype has one base docker image called nipype/base:latest, and several additional test images
for various Python versions.

The base nipype/nipype image is built as follows::
The base nipype image is built as follows::

cd path/to/nipype/
docker build -t nipype/nipype .
docker build -t nipype/base:latest -f docker/base.Dockerfile .

This base image contains several useful tools (FreeSurfer, AFNI, FSL, ANTs, etc.),
but not nipype.

This base image contains several useful tools (FreeSurfer, AFNI, FSL, ANTs, etc.) and
a nipype installation, all in Python 3.5.
It is possible to fetch a built image from the latest master branch of nipype
using::

Expand All @@ -128,26 +129,15 @@ using::
The docker run command will then open the container and offer a bash shell for the
developer.

The additional test images have several test scripts installed. For instance,
to build and run all tests on Python 2.7::

cd path/to/nipype/
docker build -f docker/Dockerfile_py27 -t nipype/nipype_test:py27 .
docker run -it --rm -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_pytests.sh

For running nipype in Python 3.5::
For building a continer for running nipype in Python 3.6::

cd path/to/nipype/
docker build -f docker/Dockerfile_py35 -t nipype/nipype_test:py35 .
docker build -f Dockerfile -t nipype/nipype_test:py36 .
docker run -it --rm -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_pytests.sh
nipype/nipype_test:py36 /usr/bin/run_pytests.sh

The last two examples assume that the example data is downladed into ~/examples and
The last examples assume that the example data is downladed into ~/examples and
the ~/scratch folder will be created if it does not exist previously.
5 changes: 5 additions & 0 deletions doc/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ Documentation

Previous versions: `0.12.0 <http://nipype.readthedocs.io/en/0.12.0/>`_ `0.11.0 <http://nipy.org/nipype/0.11.0>`_


.. container:: doc2

.. admonition:: Michael Notter's Nipype guide

Be sure to read `Michael's excellent tutorials <https://miykael.github.io/nipype_tutorial/>`_.

.. admonition:: Guides

.. hlist::
Expand Down
3 changes: 1 addition & 2 deletions doc/links_names.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@
.. _pythonxy: https://python-xy.github.io/
.. _EPD: http://www.enthought.com/products/epd.php
.. _Traits: http://code.enthought.com/projects/traits/
.. _Anaconda: https://www.continuum.io/downloads
.. _Canopy: https://www.enthought.com/products/canopy/
.. _Miniconda: https://conda.io/miniconda.html

.. Python imaging projects
.. _PyMVPA: http://www.pymvpa.org
Expand Down
40 changes: 13 additions & 27 deletions doc/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,30 @@ Downloading and installing
:maxdepth: 1

users/install
users/vagrant

Beginner's guide
================

Beginner's tutorials (IPython Notebooks). `Available here`__
Michael Notter's Nipype tutorial. `Available here`__

Michael Notter's Nipype guide. `Available here`__
__ https://miykael.github.io/nipype_tutorial/

Dissecting Nipype Workflows. `Available here`__
Nipype workshop materials
=========================

Introductory slides [older]. `Available here`__
Self-assessment questionnaire with links to learning about each piece. `Available here`__

__ https://github.com/mwaskom/nipype_concepts
__ http://miykael.github.com/nipype-beginner-s-guide/index.html
__ http://slideviewer.herokuapp.com/url/raw.github.com/nipy/nipype/master/examples/nipype_tutorial.ipynb?theme=sky
__ http://satra.github.com/intro2nipype
Lecture slides `Available here`__

User guides
===========
__ http://nipy.org/workshops/2017-03-boston/review.html
__ http://nipy.org/workshops/2017-03-boston/index.html

.. toctree::
:maxdepth: 1
`Docker containers <https://hub.docker.com/r/nipype/workshops/tags/>`_

`Github project for lectures <https://github.com/nipy/workshops/tree/gh-pages/2017-03-boston>`_
`Github project for dockerfiles + notebooks <https://github.com/nipy/workshops/tree/master/170327-nipype>`_

users/interface_tutorial
users/pipeline_tutorial
users/plugins
users/debug
`All notebooks visualized <http://nbviewer.jupyter.org/github/nipy/workshops/tree/master/170327-nipype/notebooks/>`_

Developer guides
================
Expand All @@ -47,16 +43,6 @@ Developer guides
:maxdepth: 1

devel/writing_custom_interfaces
devel/gitwash/index

.. include:: links_names.txt

Useful links for beginners
===========================

Getting started with Python - Tutorials. `Available here`__

Python for Beginners `Available here`__

__ http://www.codecademy.com/en/tracks/python
__ https://www.python.org/about/gettingstarted/
3 changes: 0 additions & 3 deletions doc/users/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@
:maxdepth: 2

install
vagrant

interface_tutorial
caching_tutorial

.. toctree::
:maxdepth: 1

pipeline_tutorial
plugins
config_file
debug
Expand Down
66 changes: 34 additions & 32 deletions doc/users/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@ This page covers the necessary steps to install Nipype.
Nipype for users
----------------

Using conda
~~~~~~~~~~~

Installing nipype from the conda-forge channel can be achieved by adding conda-forge to your channels with::

conda config --add channels conda-forge
Using docker
~~~~~~~~~~~~

You can follow the `Nipype tutorial <https://miykael.github.io/nipype_tutorial/>`_

Once the conda-forge channel has been enabled, nipype can be installed with::
Using conda
~~~~~~~~~~~

conda install nipype
Installing nipype from the conda-forge channel can be achieved by::

conda install --channel conda-forge nipype

It is possible to list all of the versions of nipype available on your platform with::

Expand All @@ -36,18 +35,23 @@ The installation process is similar to other Python packages.

If you already have a Python environment set up, you can do::

easy_install nipype

or::

pip install nipype


If you want to install all the optional features of ``nipype``,
use the following command (only for ``nipype>=0.13``)::
use the following command::

pip install nipype[all]

While `all` installs everything, one can also install select components as
listed below::

'doc': ['Sphinx>=1.4', 'matplotlib', 'pydotplus'],
'tests': ['pytest-cov', 'codecov'],
'nipy': ['nitime', 'nilearn', 'dipy', 'nipy', 'matplotlib'],
'profiler': ['psutil'],
'duecredit': ['duecredit'],
'xvfbwrapper': ['xvfbwrapper'],


Debian and Ubuntu
~~~~~~~~~~~~~~~~~
Expand All @@ -59,11 +63,14 @@ manager.
Mac OS X
~~~~~~~~

The easiest way to get nipype running on Mac OS X is to install Anaconda_ or
Canopy_ and then add nipype by executing::
The easiest way to get nipype running on Mac OS X is to install Miniconda_ and
follow the instructions above. If you have a non-conda environment you can
install nipype by typing::

easy_install nipype
pip install nipype

Note that the above procedure may require availability of gcc on your system
path to compile the traits package.

From source
~~~~~~~~~~~
Expand All @@ -79,47 +86,42 @@ If you downloaded the source distribution named something
like ``nipype-x.y.tar.gz``, then unpack the tarball, change into the
``nipype-x.y`` directory and install nipype using::

python setup.py install
pip install .

**Note:** Depending on permissions you may need to use ``sudo``.


Testing the install
-------------------

The best way to test the install is checking nipype's version ::
The best way to test the install is checking nipype's version and then running
the tests::

python -c "import nipype; print(nipype.__version__)"

python -c "import nipype; nipype.test()"

Installation for developers
---------------------------

Developers should start `here <../devel/testing_nipype.html>`_.


Recommended Software
------------
--------------------

Strong Recommendations
~~~~~~~~~~~~~~~~~~~~~~

IPython_ 0.10.2 - 1.0.0
Interactive python environment. This is necessary for some parallel
components of the pipeline engine.
IPython_
Interactive python environment.

Matplotlib_ 1.0 - 1.2
Matplotlib_
Plotting library

`RDFLib <http://rdflib.readthedocs.org/en/latest/>`_ 4.1
RDFLibrary required for provenance export as RDF

Sphinx_ 1.1
Required for building the documentation

`Graphviz <http://www.graphviz.org/>`_
Required for building the documentation. The python wrapper package (``graphviz``)
and the program itself both need to be installed.
Required for building the documentation.

Interface Dependencies
~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -148,7 +150,7 @@ Slicer_
3.6 or later

Nipy_
0.1.2+20110404 or later
0.4 or later

Nitime_
(optional)
Expand Down
4 changes: 2 additions & 2 deletions doc/users/resource_sched_profiler.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. _resource_sched_profiler:

============================================
=============================================
Resource Scheduling and Profiling with Nipype
============================================
=============================================
The latest version of Nipype supports system resource scheduling and profiling.
These features allows users to ensure high throughput of their data processing
while also controlling the amount of computing resources a given workflow will
Expand Down
2 changes: 2 additions & 0 deletions docker/base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ RUN apt-get update && \
apt-utils \
fusefat \
make \
# Added g++ to compile dipy in py3.6
g++=4:5.3.1-1ubuntu1 \
ruby=1:2.3.0+1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Expand Down
6 changes: 1 addition & 5 deletions nipype/external/due.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@ def _donothing_func(*args, **kwargs):
if 'due' in locals() and not hasattr(due, 'cite'):
raise RuntimeError(
"Imported due lacks .cite. DueCredit is now disabled")
except Exception as e:
if type(e).__name__ != 'ImportError':
import logging
logging.getLogger("duecredit").error(
"Failed to import duecredit due to %s" % str(e))
except ImportError:
# Initiate due stub
due = InactiveDueCreditCollector()
BibTeX = Doi = Url = _donothing_func
Expand Down
Loading