Skip to content

FIX: Backport #826 to 2.5.x #827

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 2 commits into from
Oct 16, 2019
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
8 changes: 4 additions & 4 deletions nibabel/arraywriters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand Down Expand Up @@ -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
----------
Expand Down Expand Up @@ -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
----------
Expand Down Expand Up @@ -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
----------
Expand Down
4 changes: 2 additions & 2 deletions nibabel/brikhead.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion nibabel/deprecator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import warnings
import re

_LEADING_WHITE = re.compile('^(\s*)')
_LEADING_WHITE = re.compile(r'^(\s*)')


class ExpiredDeprecationError(RuntimeError):
Expand Down
2 changes: 1 addition & 1 deletion nibabel/externals/netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion nibabel/fileholders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand Down
3 changes: 2 additions & 1 deletion nibabel/funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand All @@ -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``
Expand Down
2 changes: 1 addition & 1 deletion nibabel/loadsave.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand Down
2 changes: 1 addition & 1 deletion nibabel/openers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion nibabel/streamlines/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand Down
4 changes: 2 additions & 2 deletions nibabel/streamlines/tractogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down