diff --git a/nibabel/affines.py b/nibabel/affines.py index d21db6958e..432106743e 100644 --- a/nibabel/affines.py +++ b/nibabel/affines.py @@ -238,7 +238,7 @@ def append_diag(aff, steps, starts=()): def dot_reduce(*args): - """ Apply numpy dot product function from right to left on arrays + r""" Apply numpy dot product function from right to left on arrays For passed arrays :math:`A, B, C, ... Z` returns :math:`A \dot B \dot C ... \dot Z` where "." is the numpy array dot product. diff --git a/nibabel/info.py b/nibabel/info.py index ef9cd81e54..0ef4557308 100644 --- a/nibabel/info.py +++ b/nibabel/info.py @@ -32,7 +32,7 @@ def _parse_version(version_str): """ Parse version string `version_str` in our format """ - match = re.match('([0-9.]*\d)(.*)', version_str) + match = re.match(r'([0-9.]*\d)(.*)', version_str) if match is None: raise ValueError('Invalid version ' + version_str) return match.groups() diff --git a/nibabel/testing/__init__.py b/nibabel/testing/__init__.py index 60ecd2ceea..a1960249cd 100644 --- a/nibabel/testing/__init__.py +++ b/nibabel/testing/__init__.py @@ -18,7 +18,11 @@ import numpy as np from numpy.testing import assert_array_equal -from numpy.testing.decorators import skipif +try: + from numpy.testing import dec + skipif = dec.skipif +except ImportError: + from numpy.testing.decorators import skipif # Allow failed import of nose if not now running tests try: from nose.tools import (assert_equal, assert_not_equal,