diff --git a/.travis.yml b/.travis.yml index 00baeb8dc3..f79018dd50 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,7 @@ env: - 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" + - CHECK_TYPE=test matrix: - INSTALL_DEB_DEPENDECIES=true NIPYPE_EXTRAS="doc,tests,nipy,profiler" @@ -31,6 +32,13 @@ env: EXTRA_PIP_FLAGS="--pre $EXTRA_PIP_FLAGS --find-links $PRE_WHEELS" CI_SKIP_TEST=1 +matrix: + include: + - python: 3.7 + env: + - NIPYPE_EXTRAS=dev + CHECK_TYPE=specs + addons: apt: packages: @@ -64,7 +72,16 @@ install: - travis_retry pip install pytest-xdist script: -- py.test -v --cov nipype --cov-config .coveragerc --cov-report xml:cov.xml -c nipype/pytest.ini --doctest-modules nipype -n auto +- | + if [ "$CHECK_TYPE" = "test" ]; then + py.test -v --cov nipype --cov-config .coveragerc --cov-report xml:cov.xml -c nipype/pytest.ini --doctest-modules nipype -n auto + fi +- | + if [ "$CHECK_TYPE" = "specs" ]; then + make specs + git add nipype + test "$( git diff --cached | wc -l )" -eq 0 || ( git diff --cached && false ) + fi after_script: - codecov --file cov.xml --flags unittests -e TRAVIS_JOB_NUMBER diff --git a/nipype/interfaces/afni/tests/test_auto_Remlfit.py b/nipype/interfaces/afni/tests/test_auto_Remlfit.py index 05ee75210e..b1afa427b1 100644 --- a/nipype/interfaces/afni/tests/test_auto_Remlfit.py +++ b/nipype/interfaces/afni/tests/test_auto_Remlfit.py @@ -46,6 +46,7 @@ def test_Remlfit_inputs(): extensions=None, ), gltsym=dict(argstr='-gltsym "%s" %s...', ), + goforit=dict(argstr='-GOFORIT', ), in_files=dict( argstr='-input "%s"', copyfile=False, diff --git a/nipype/interfaces/afni/utils.py b/nipype/interfaces/afni/utils.py index 38a9da3efb..b728d8c902 100644 --- a/nipype/interfaces/afni/utils.py +++ b/nipype/interfaces/afni/utils.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- -# vi: set ft = python sts = 4 ts = 4 sw = 4 et: +# vi: set ft=python sts=4 ts=4 sw=4 et: """ AFNI utility interfaces. @@ -213,9 +213,9 @@ class Autobox(AFNICommand): def aggregate_outputs(self, runtime=None, needed_outputs=None): outputs = super(Autobox, self).aggregate_outputs( runtime, needed_outputs) - pattern = 'x=(?P-?\d+)\.\.(?P-?\d+) '\ - 'y=(?P-?\d+)\.\.(?P-?\d+) '\ - 'z=(?P-?\d+)\.\.(?P-?\d+)' + pattern = r'x=(?P-?\d+)\.\.(?P-?\d+) '\ + r'y=(?P-?\d+)\.\.(?P-?\d+) '\ + r'z=(?P-?\d+)\.\.(?P-?\d+)' for line in runtime.stderr.split('\n'): m = re.search(pattern, line) if m: diff --git a/nipype/interfaces/diffusion_toolkit/dti.py b/nipype/interfaces/diffusion_toolkit/dti.py index 570ae55df5..f6776c2e95 100644 --- a/nipype/interfaces/diffusion_toolkit/dti.py +++ b/nipype/interfaces/diffusion_toolkit/dti.py @@ -94,7 +94,7 @@ class DTIRecon(CommandLine): def _create_gradient_matrix(self, bvecs_file, bvals_file): _gradient_matrix_file = 'gradient_matrix.txt' with open(bvals_file) as fbvals: - bvals = [val for val in re.split('\s+', fbvals.readline().strip())] + bvals = [val for val in re.split(r'\s+', fbvals.readline().strip())] with open(bvecs_file) as fbvecs: bvecs_x = fbvecs.readline().split() bvecs_y = fbvecs.readline().split() diff --git a/nipype/interfaces/dipy/tracks.py b/nipype/interfaces/dipy/tracks.py index 60b5127dd1..81d76d1ef5 100644 --- a/nipype/interfaces/dipy/tracks.py +++ b/nipype/interfaces/dipy/tracks.py @@ -5,7 +5,6 @@ import os.path as op import numpy as np import nibabel as nb -import nibabel.trackvis as nbt from distutils.version import LooseVersion from ... import logging @@ -89,6 +88,7 @@ class TrackDensityMap(DipyBaseInterface): def _run_interface(self, runtime): from numpy import min_scalar_type from dipy.tracking.utils import density_map + import nibabel.trackvis as nbt tracks, header = nbt.read(self.inputs.in_file) streams = ((ii[0]) for ii in tracks) diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index a572259e2e..e0b430a2be 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -858,18 +858,18 @@ def _run_interface(self, runtime): runtime = super(AvScale, self)._run_interface(runtime) expr = re.compile( - 'Rotation\ &\ Translation\ Matrix:\n(?P[0-9\.\ \n-]+)[\s\n]*' - '(Rotation\ Angles\ \(x,y,z\)\ \[rads\]\ =\ (?P[0-9\.\ -]+))?[\s\n]*' - '(Translations\ \(x,y,z\)\ \[mm\]\ =\ (?P[0-9\.\ -]+))?[\s\n]*' - 'Scales\ \(x,y,z\)\ =\ (?P[0-9\.\ -]+)[\s\n]*' - 'Skews\ \(xy,xz,yz\)\ =\ (?P[0-9\.\ -]+)[\s\n]*' - 'Average\ scaling\ =\ (?P[0-9\.-]+)[\s\n]*' - 'Determinant\ =\ (?P[0-9\.-]+)[\s\n]*' - 'Left-Right\ orientation:\ (?P[A-Za-z]+)[\s\n]*' - 'Forward\ half\ transform\ =[\s]*\n' - '(?P[0-9\.\ \n-]+)[\s\n]*' - 'Backward\ half\ transform\ =[\s]*\n' - '(?P[0-9\.\ \n-]+)[\s\n]*') + r'Rotation & Translation Matrix:\n(?P[0-9\. \n-]+)[\s\n]*' + r'(Rotation Angles \(x,y,z\) \[rads\] = (?P[0-9\. -]+))?[\s\n]*' + r'(Translations \(x,y,z\) \[mm\] = (?P[0-9\. -]+))?[\s\n]*' + r'Scales \(x,y,z\) = (?P[0-9\. -]+)[\s\n]*' + r'Skews \(xy,xz,yz\) = (?P[0-9\. -]+)[\s\n]*' + r'Average scaling = (?P[0-9\.-]+)[\s\n]*' + r'Determinant = (?P[0-9\.-]+)[\s\n]*' + r'Left-Right orientation: (?P[A-Za-z]+)[\s\n]*' + r'Forward half transform =[\s]*\n' + r'(?P[0-9\. \n-]+)[\s\n]*' + r'Backward half transform =[\s]*\n' + r'(?P[0-9\. \n-]+)[\s\n]*') out = expr.search(runtime.stdout).groupdict() outputs = {} outputs['rotation_translation_matrix'] = [[ diff --git a/nipype/interfaces/image.py b/nipype/interfaces/image.py index 50fad60ebb..d72bb47c42 100644 --- a/nipype/interfaces/image.py +++ b/nipype/interfaces/image.py @@ -43,8 +43,8 @@ class Rescale(SimpleInterface): Examples -------- - To use a high-resolution T1w image as a registration target for a T2\* - image, it may be useful to invert the T1w image and rescale to the T2\* + To use a high-resolution T1w image as a registration target for a T2\\* + image, it may be useful to invert the T1w image and rescale to the T2\\* range. Using the 1st and 99th percentiles may reduce the impact of outlier voxels. diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index c409d4e78a..b3376903bd 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -1466,7 +1466,7 @@ class DataFinder(IOBase): >>> from nipype.interfaces.io import DataFinder >>> df = DataFinder() >>> df.inputs.root_paths = '.' - >>> df.inputs.match_regex = '.+/(?P.+(qT1|ep2d_fid_T1).+)/(?P.+)\.nii.gz' + >>> df.inputs.match_regex = r'.+/(?P.+(qT1|ep2d_fid_T1).+)/(?P.+)\.nii.gz' >>> result = df.run() # doctest: +SKIP >>> result.outputs.out_paths # doctest: +SKIP ['./027-ep2d_fid_T1_Gd4/acquisition.nii.gz', diff --git a/nipype/interfaces/tests/test_io.py b/nipype/interfaces/tests/test_io.py index 4420e4a49c..19625b0f68 100644 --- a/nipype/interfaces/tests/test_io.py +++ b/nipype/interfaces/tests/test_io.py @@ -524,7 +524,7 @@ def test_datafinder_unpack(tmpdir): df = nio.DataFinder() df.inputs.root_paths = outdir - df.inputs.match_regex = '.+/(?P.+)\.txt' + df.inputs.match_regex = r'.+/(?P.+)\.txt' df.inputs.unpack_single = True result = df.run() print(result.outputs.out_paths) diff --git a/nipype/interfaces/utility/base.py b/nipype/interfaces/utility/base.py index d01a0a17b9..8ae05ad66b 100644 --- a/nipype/interfaces/utility/base.py +++ b/nipype/interfaces/utility/base.py @@ -254,7 +254,7 @@ class Rename(SimpleInterface, IOBase): >>> rename3 = Rename(format_string="%(subject_id)s_%(seq)s_run%(run)02d.nii") >>> rename3.inputs.in_file = os.path.join(datadir, "func_epi_1_1.nii") - >>> rename3.inputs.parse_string = "func_(?P\w*)_.*" + >>> rename3.inputs.parse_string = r"func_(?P\w*)_.*" >>> rename3.inputs.subject_id = "subj_201" >>> rename3.inputs.run = 2 >>> res = rename3.run() # doctest: +SKIP diff --git a/nipype/pipeline/engine/utils.py b/nipype/pipeline/engine/utils.py index fab1fb14de..a5245dda48 100644 --- a/nipype/pipeline/engine/utils.py +++ b/nipype/pipeline/engine/utils.py @@ -235,7 +235,7 @@ def save_resultfile(result, cwd, name, rebase=None): logger.debug("Saving results file: '%s'", resultsfile) if result.outputs is None: - logger.warn('Storing result file without outputs') + logger.warning('Storing result file without outputs') savepkl(resultsfile, result) return try: