diff --git a/nibabel/arraywriters.py b/nibabel/arraywriters.py index fa2d1e4e1c..c5c0efb706 100644 --- a/nibabel/arraywriters.py +++ b/nibabel/arraywriters.py @@ -49,7 +49,7 @@ class ScalingError(WriterError): class ArrayWriter(object): def __init__(self, array, out_dtype=None, **kwargs): - """ Initialize array writer + r""" Initialize array writer Parameters ---------- @@ -246,7 +246,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 ---------- @@ -477,7 +477,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 ---------- @@ -750,7 +750,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 c5847a87a8..3ddfd2e8ad 100644 --- a/nibabel/brikhead.py +++ b/nibabel/brikhead.py @@ -83,8 +83,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 30b30f5a7f..7adaf32dc1 100644 --- a/nibabel/externals/netcdf.py +++ b/nibabel/externals/netcdf.py @@ -776,7 +776,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 178ac8191c..b5fa5d0b4b 100644 --- a/nibabel/funcs.py +++ b/nibabel/funcs.py @@ -87,7 +87,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 ---------- @@ -101,6 +101,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 421b95ba2f..d603dd619c 100644 --- a/nibabel/loadsave.py +++ b/nibabel/loadsave.py @@ -21,7 +21,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 e0706c4998..a658c65c0a 100644 --- a/nibabel/openers.py +++ b/nibabel/openers.py @@ -54,7 +54,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 7f999ca19b..102ad8fd01 100644 --- a/nibabel/streamlines/__init__.py +++ b/nibabel/streamlines/__init__.py @@ -96,7 +96,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 11d72ac78a..c6687b82aa 100644 --- a/nibabel/streamlines/tractogram.py +++ b/nibabel/streamlines/tractogram.py @@ -20,7 +20,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 @@ -73,7 +73,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