Skip to content

CI: Stop using Miniconda on Travis #2600

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 6 commits into from
Jun 18, 2018
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
35 changes: 19 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,24 @@ python:
- 3.6

env:
- INSTALL_DEB_DEPENDECIES=true NIPYPE_EXTRAS="doc,tests,fmri,profiler" CI_SKIP_TEST=1
- INSTALL_DEB_DEPENDECIES=false NIPYPE_EXTRAS="doc,tests,fmri,profiler" CI_SKIP_TEST=1
- INSTALL_DEB_DEPENDECIES=true NIPYPE_EXTRAS="doc,tests,fmri,profiler,duecredit,ssh" CI_SKIP_TEST=1
- INSTALL_DEB_DEPENDECIES=true NIPYPE_EXTRAS="doc,tests,fmri,profiler" PIP_FLAGS="--pre" CI_SKIP_TEST=1
global:
- EXTRA_WHEELS="https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com"
- PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"
- EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS"
matrix:
- INSTALL_DEB_DEPENDECIES=true
NIPYPE_EXTRAS="doc,tests,fmri,profiler"
CI_SKIP_TEST=1
- INSTALL_DEB_DEPENDECIES=false
NIPYPE_EXTRAS="doc,tests,fmri,profiler"
CI_SKIP_TEST=1
- INSTALL_DEB_DEPENDECIES=true
NIPYPE_EXTRAS="doc,tests,fmri,profiler,duecredit,ssh"
CI_SKIP_TEST=1
- INSTALL_DEB_DEPENDECIES=true
NIPYPE_EXTRAS="doc,tests,fmri,profiler"
EXTRA_PIP_FLAGS="--pre $EXTRA_PIP_FLAGS --find-links $PRE_WHEELS"
CI_SKIP_TEST=1

addons:
apt:
Expand All @@ -39,23 +53,12 @@ before_install:
export FSLOUTPUTTYPE=NIFTI_GZ;
fi;

# handle python operations separately to reduce timeouts
- wget https://repo.continuum.io/miniconda/Miniconda${TRAVIS_PYTHON_VERSION:0:1}-latest-Linux-x86_64.sh
-O /home/travis/.cache/conda.sh
- bash ${HOME}/.cache/conda.sh -b -p ${HOME}/conda
- export PATH=${HOME}/conda/bin:$PATH
- hash -r
- conda config --set always_yes yes --set changeps1 no
- travis_retry conda update -q conda
- conda config --add channels conda-forge
- travis_retry conda install -y python=${TRAVIS_PYTHON_VERSION} icu
- travis_retry pip install -r requirements.txt
- travis_retry git clone https://github.com/INCF/pybids.git ${HOME}/pybids &&
pip install -e ${HOME}/pybids
- travis_retry pip install codecov

install:
- travis_retry pip install $PIP_FLAGS -e .[$NIPYPE_EXTRAS]
- travis_retry pip install $EXTRA_PIP_FLAGS -e .[$NIPYPE_EXTRAS]

script:
- py.test -v --cov nipype --cov-config .coveragerc --cov-report xml:cov.xml -c nipype/pytest.ini --doctest-modules nipype
Expand Down
14 changes: 2 additions & 12 deletions nipype/interfaces/base/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,13 +692,8 @@ class SimpleInterface(BaseInterface):
Examples
--------

.. testsetup::

>>> from .specs import TraitedSpec
>>> tmp = getfixture('tmpdir')
>>> old = tmp.chdir() # changing to a temporary directory

.. doctest::
>>> from nipype.interfaces.base import (
... SimpleInterface, BaseInterfaceInputSpec, TraitedSpec)

>>> def double(x):
... return 2 * x
Expand All @@ -721,11 +716,6 @@ class SimpleInterface(BaseInterface):
>>> dbl.inputs.x = 2
>>> dbl.run().outputs.doubled
4.0

.. testsetup::

>>> os.chdir(old.strpath)

"""

def __init__(self, from_file=None, resource_monitor=None, **inputs):
Expand Down
20 changes: 4 additions & 16 deletions nipype/interfaces/dcm2nii.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,26 +106,14 @@ class Dcm2nii(CommandLine):
Examples
========

.. testsetup::

>>> tmp = getfixture('tmpdir')
>>> old = tmp.chdir() # changing to a temporary directory

.. doctest::

>>> from nipype.interfaces.dcm2nii import Dcm2nii
>>> converter = Dcm2nii()
>>> converter.inputs.source_names = [os.path.join(datadir, 'functional_1.dcm'), os.path.join(datadir, 'functional_2.dcm')]
>>> converter.inputs.source_names = ['functional_1.dcm', 'functional_2.dcm']
>>> converter.inputs.gzip_output = True
>>> converter.inputs.output_dir = '.'
>>> converter.cmdline #doctest: +ELLIPSIS
'dcm2nii -a y -c y -b config.ini -v y -d y -e y -g y -i n -n y -o . -p y -x n -f n ...functional_1.dcm'

.. testsetup::

>>> os.chdir(old.strpath)

"""
>>> converter.cmdline # doctest: +ELLIPSIS
'dcm2nii -a y -c y -b config.ini -v y -d y -e y -g y -i n -n y -o . -p y -x n -f n functional_1.dcm'
"""

input_spec = Dcm2niiInputSpec
output_spec = Dcm2niiOutputSpec
Expand Down
109 changes: 57 additions & 52 deletions nipype/interfaces/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,58 +32,63 @@ class ReorientOutputSpec(TraitedSpec):
class Reorient(SimpleInterface):
"""Conform an image to a given orientation

Flips and reorder the image data array so that the axes match the
directions indicated in ``orientation``.
The default ``RAS`` orientation corresponds to the first axis being ordered
from left to right, the second axis from posterior to anterior, and the
third axis from inferior to superior.

For oblique images, the original orientation is considered to be the
closest plumb orientation.

No resampling is performed, and thus the output image is not de-obliqued
or registered to any other image or template.

The effective transform is calculated from the original affine matrix to
the reoriented affine matrix.

Examples
--------

If an image is not reoriented, the original file is not modified

>>> import numpy as np
>>> from nipype.interfaces.image import Reorient
>>> reorient = Reorient(orientation='LPS')
>>> reorient.inputs.in_file = 'segmentation0.nii.gz'
>>> res = reorient.run()
>>> res.outputs.out_file
'segmentation0.nii.gz'

>>> print(np.loadtxt(res.outputs.transform))
[[1. 0. 0. 0.]
[0. 1. 0. 0.]
[0. 0. 1. 0.]
[0. 0. 0. 1.]]

>>> reorient.inputs.orientation = 'RAS'
>>> res = reorient.run()
>>> res.outputs.out_file # doctest: +ELLIPSIS
'.../segmentation0_ras.nii.gz'

>>> print(np.loadtxt(res.outputs.transform))
[[-1. 0. 0. 60.]
[ 0. -1. 0. 72.]
[ 0. 0. 1. 0.]
[ 0. 0. 0. 1.]]

.. testcleanup::

>>> import os
>>> os.unlink(res.outputs.out_file)
>>> os.unlink(res.outputs.transform)

"""
Flips and reorder the image data array so that the axes match the
directions indicated in ``orientation``.
The default ``RAS`` orientation corresponds to the first axis being ordered
from left to right, the second axis from posterior to anterior, and the
third axis from inferior to superior.

For oblique images, the original orientation is considered to be the
closest plumb orientation.

No resampling is performed, and thus the output image is not de-obliqued
or registered to any other image or template.

The effective transform is calculated from the original affine matrix to
the reoriented affine matrix.

Examples
--------

If an image is not reoriented, the original file is not modified

.. testsetup::

>>> def print_affine(matrix):
... print(str(matrix).replace(']', ' ').replace('[', ' '))

>>> import numpy as np
>>> from nipype.interfaces.image import Reorient
>>> reorient = Reorient(orientation='LPS')
>>> reorient.inputs.in_file = 'segmentation0.nii.gz'
>>> res = reorient.run()
>>> res.outputs.out_file
'segmentation0.nii.gz'

>>> print_affine(np.loadtxt(res.outputs.transform))
1. 0. 0. 0.
0. 1. 0. 0.
0. 0. 1. 0.
0. 0. 0. 1.

>>> reorient.inputs.orientation = 'RAS'
>>> res = reorient.run()
>>> res.outputs.out_file # doctest: +ELLIPSIS
'.../segmentation0_ras.nii.gz'

>>> print_affine(np.loadtxt(res.outputs.transform))
-1. 0. 0. 60.
0. -1. 0. 72.
0. 0. 1. 0.
0. 0. 0. 1.

.. testcleanup::

>>> import os
>>> os.unlink(res.outputs.out_file)
>>> os.unlink(res.outputs.transform)

"""
input_spec = ReorientInputSpec
output_spec = ReorientOutputSpec

Expand Down
12 changes: 0 additions & 12 deletions nipype/interfaces/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -2585,13 +2585,6 @@ class JSONFileGrabber(IOBase):
Example
-------

.. testsetup::

>>> tmp = getfixture('tmpdir')
>>> old = tmp.chdir() # changing to a temporary directory

.. doctest::

>>> import pprint
>>> from nipype.interfaces.io import JSONFileGrabber
>>> jsonSource = JSONFileGrabber()
Expand All @@ -2603,11 +2596,6 @@ class JSONFileGrabber(IOBase):
>>> res = jsonSource.run()
>>> pprint.pprint(res.outputs.get()) # doctest:, +ELLIPSIS
{'param1': 'exampleStr', 'param2': 4, 'param3': 1.0}

.. testsetup::

>>> os.chdir(old.strpath)

"""
input_spec = JSONFileGrabberInputSpec
output_spec = DynamicTraitedSpec
Expand Down
12 changes: 0 additions & 12 deletions nipype/interfaces/niftyreg/regutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,13 +450,6 @@ class RegAverage(NiftyRegCommand):
Examples
--------

.. testsetup::

>>> tmp = getfixture('tmpdir')
>>> old = tmp.chdir() # changing to temporary file

.. doctest::

>>> from nipype.interfaces import niftyreg
>>> node = niftyreg.RegAverage()
>>> one_file = 'im1.nii'
Expand All @@ -465,11 +458,6 @@ class RegAverage(NiftyRegCommand):
>>> node.inputs.avg_files = [one_file, two_file, three_file]
>>> node.cmdline # doctest: +ELLIPSIS
'reg_average --cmd_file .../reg_average_cmd'

.. testsetup::

>>> os.chdir(old.strpath)

"""
_cmd = get_custom_path('reg_average')
input_spec = RegAverageInputSpec
Expand Down