diff --git a/nibabel/arraywriters.py b/nibabel/arraywriters.py index 2bd29e4ca4..485d447204 100644 --- a/nibabel/arraywriters.py +++ b/nibabel/arraywriters.py @@ -50,7 +50,7 @@ class ScalingError(WriterError): class ArrayWriter(object): def __init__(self, array, out_dtype=None, **kwargs): - """ Initialize array writer + r""" Initialize array writer Parameters ---------- @@ -247,7 +247,7 @@ class SlopeArrayWriter(ArrayWriter): def __init__(self, array, out_dtype=None, calc_scale=True, scaler_dtype=np.float32, **kwargs): - """ Initialize array writer + r""" Initialize array writer Parameters ---------- @@ -478,7 +478,7 @@ class SlopeInterArrayWriter(SlopeArrayWriter): def __init__(self, array, out_dtype=None, calc_scale=True, scaler_dtype=np.float32, **kwargs): - """ Initialize array writer + r""" Initialize array writer Parameters ---------- @@ -751,7 +751,7 @@ def get_slope_inter(writer): def make_array_writer(data, out_type, has_slope=True, has_intercept=True, **kwargs): - """ Make array writer instance for array `data` and output type `out_type` + r""" Make array writer instance for array `data` and output type `out_type` Parameters ---------- diff --git a/nibabel/brikhead.py b/nibabel/brikhead.py index 1a12abfbca..a1d338b469 100644 --- a/nibabel/brikhead.py +++ b/nibabel/brikhead.py @@ -85,8 +85,8 @@ class AFNIHeaderError(HeaderDataError): DATA_OFFSET = 0 -TYPE_RE = re.compile('type\s*=\s*(string|integer|float)-attribute\s*\n') -NAME_RE = re.compile('name\s*=\s*(\w+)\s*\n') +TYPE_RE = re.compile(r'type\s*=\s*(string|integer|float)-attribute\s*\n') +NAME_RE = re.compile(r'name\s*=\s*(\w+)\s*\n') def _unpack_var(var): diff --git a/nibabel/deprecator.py b/nibabel/deprecator.py index 32a7c6835c..a0b7b8535a 100644 --- a/nibabel/deprecator.py +++ b/nibabel/deprecator.py @@ -5,7 +5,7 @@ import warnings import re -_LEADING_WHITE = re.compile('^(\s*)') +_LEADING_WHITE = re.compile(r'^(\s*)') class ExpiredDeprecationError(RuntimeError): diff --git a/nibabel/externals/netcdf.py b/nibabel/externals/netcdf.py index 3fcb4cd55a..1674f12b4c 100644 --- a/nibabel/externals/netcdf.py +++ b/nibabel/externals/netcdf.py @@ -779,7 +779,7 @@ def _read_att_values(self): values = self.fp.read(int(count)) self.fp.read(-count % 4) # read padding - if typecode is not 'c': + if typecode != 'c': values = frombuffer(values, dtype='>%s' % typecode).copy() if values.shape == (1,): values = values[0] diff --git a/nibabel/fileholders.py b/nibabel/fileholders.py index 5a858f1dbf..35cfd3c348 100644 --- a/nibabel/fileholders.py +++ b/nibabel/fileholders.py @@ -99,7 +99,7 @@ def file_like(self): def copy_file_map(file_map): - ''' Copy mapping of fileholders given by `file_map` + r''' Copy mapping of fileholders given by `file_map` Parameters ---------- diff --git a/nibabel/funcs.py b/nibabel/funcs.py index 240b20f802..54e69cc3e4 100644 --- a/nibabel/funcs.py +++ b/nibabel/funcs.py @@ -88,7 +88,7 @@ def squeeze_image(img): def concat_images(images, check_affines=True, axis=None): - ''' Concatenate images in list to single image, along specified dimension + r''' Concatenate images in list to single image, along specified dimension Parameters ---------- @@ -102,6 +102,7 @@ def concat_images(images, check_affines=True, axis=None): be the same shape. If not None, concatenates on the specified dimension. This requires all images to be the same shape, except on the specified dimension. + Returns ------- concat_img : ``SpatialImage`` diff --git a/nibabel/loadsave.py b/nibabel/loadsave.py index 8c3041e73c..9c11423f72 100644 --- a/nibabel/loadsave.py +++ b/nibabel/loadsave.py @@ -22,7 +22,7 @@ def load(filename, **kwargs): - ''' Load file given filename, guessing at file type + r''' Load file given filename, guessing at file type Parameters ---------- diff --git a/nibabel/openers.py b/nibabel/openers.py index e551404561..dd4366bdf0 100644 --- a/nibabel/openers.py +++ b/nibabel/openers.py @@ -111,7 +111,7 @@ def _gzip_open(filename, mode='rb', compresslevel=9, keep_open=False): class Opener(object): - """ Class to accept, maybe open, and context-manage file-likes / filenames + r""" Class to accept, maybe open, and context-manage file-likes / filenames Provides context manager to close files that the constructor opened for you. diff --git a/nibabel/streamlines/__init__.py b/nibabel/streamlines/__init__.py index 84d810367e..6c73714dcc 100644 --- a/nibabel/streamlines/__init__.py +++ b/nibabel/streamlines/__init__.py @@ -97,7 +97,7 @@ def load(fileobj, lazy_load=False): def save(tractogram, filename, **kwargs): - """ Saves a tractogram to a file. + r""" Saves a tractogram to a file. Parameters ---------- diff --git a/nibabel/streamlines/tractogram.py b/nibabel/streamlines/tractogram.py index 209ed27c26..5f98a1bcf1 100644 --- a/nibabel/streamlines/tractogram.py +++ b/nibabel/streamlines/tractogram.py @@ -25,7 +25,7 @@ def is_lazy_dict(obj): class SliceableDataDict(MutableMapping): - """ Dictionary for which key access can do slicing on the values. + r""" Dictionary for which key access can do slicing on the values. This container behaves like a standard dictionary but extends key access to allow keys for key access to be indices slicing into the contained ndarray @@ -78,7 +78,7 @@ def __len__(self): class PerArrayDict(SliceableDataDict): - """ Dictionary for which key access can do slicing on the values. + r""" Dictionary for which key access can do slicing on the values. This container behaves like a standard dictionary but extends key access to allow keys for key access to be indices slicing into the contained ndarray