Skip to content

Commit dd52697

Browse files
committed
BUG: More escapes
1 parent 7eaa3ae commit dd52697

File tree

10 files changed

+16
-15
lines changed

10 files changed

+16
-15
lines changed

nibabel/arraywriters.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class ScalingError(WriterError):
4949
class ArrayWriter(object):
5050

5151
def __init__(self, array, out_dtype=None, **kwargs):
52-
""" Initialize array writer
52+
r""" Initialize array writer
5353
5454
Parameters
5555
----------
@@ -246,7 +246,7 @@ class SlopeArrayWriter(ArrayWriter):
246246

247247
def __init__(self, array, out_dtype=None, calc_scale=True,
248248
scaler_dtype=np.float32, **kwargs):
249-
""" Initialize array writer
249+
r""" Initialize array writer
250250
251251
Parameters
252252
----------
@@ -477,7 +477,7 @@ class SlopeInterArrayWriter(SlopeArrayWriter):
477477

478478
def __init__(self, array, out_dtype=None, calc_scale=True,
479479
scaler_dtype=np.float32, **kwargs):
480-
""" Initialize array writer
480+
r""" Initialize array writer
481481
482482
Parameters
483483
----------
@@ -750,7 +750,7 @@ def get_slope_inter(writer):
750750

751751
def make_array_writer(data, out_type, has_slope=True, has_intercept=True,
752752
**kwargs):
753-
""" Make array writer instance for array `data` and output type `out_type`
753+
r""" Make array writer instance for array `data` and output type `out_type`
754754
755755
Parameters
756756
----------

nibabel/brikhead.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ class AFNIHeaderError(HeaderDataError):
8383

8484

8585
DATA_OFFSET = 0
86-
TYPE_RE = re.compile('type\s*=\s*(string|integer|float)-attribute\s*\n')
87-
NAME_RE = re.compile('name\s*=\s*(\w+)\s*\n')
86+
TYPE_RE = re.compile(r'type\s*=\s*(string|integer|float)-attribute\s*\n')
87+
NAME_RE = re.compile(r'name\s*=\s*(\w+)\s*\n')
8888

8989

9090
def _unpack_var(var):

nibabel/deprecator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import warnings
66
import re
77

8-
_LEADING_WHITE = re.compile('^(\s*)')
8+
_LEADING_WHITE = re.compile(r'^(\s*)')
99

1010

1111
class ExpiredDeprecationError(RuntimeError):

nibabel/externals/netcdf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ def _read_att_values(self):
776776
values = self.fp.read(int(count))
777777
self.fp.read(-count % 4) # read padding
778778

779-
if typecode is not 'c':
779+
if typecode != 'c':
780780
values = frombuffer(values, dtype='>%s' % typecode).copy()
781781
if values.shape == (1,):
782782
values = values[0]

nibabel/fileholders.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def file_like(self):
9999

100100

101101
def copy_file_map(file_map):
102-
''' Copy mapping of fileholders given by `file_map`
102+
r''' Copy mapping of fileholders given by `file_map`
103103
104104
Parameters
105105
----------

nibabel/funcs.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def squeeze_image(img):
8787

8888

8989
def concat_images(images, check_affines=True, axis=None):
90-
''' Concatenate images in list to single image, along specified dimension
90+
r''' Concatenate images in list to single image, along specified dimension
9191
9292
Parameters
9393
----------
@@ -101,6 +101,7 @@ def concat_images(images, check_affines=True, axis=None):
101101
be the same shape. If not None, concatenates on the specified
102102
dimension. This requires all images to be the same shape, except on
103103
the specified dimension.
104+
104105
Returns
105106
-------
106107
concat_img : ``SpatialImage``

nibabel/loadsave.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
def load(filename, **kwargs):
24-
''' Load file given filename, guessing at file type
24+
r''' Load file given filename, guessing at file type
2525
2626
Parameters
2727
----------

nibabel/openers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def _gzip_open(filename, mode='rb', compresslevel=9, keep_open=False):
5454

5555

5656
class Opener(object):
57-
r"""Class to accept, maybe open, and context-manage file-likes / filenames
57+
r""" Class to accept, maybe open, and context-manage file-likes / filenames
5858
5959
Provides context manager to close files that the constructor opened for
6060
you.

nibabel/streamlines/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def load(fileobj, lazy_load=False):
9696

9797

9898
def save(tractogram, filename, **kwargs):
99-
""" Saves a tractogram to a file.
99+
r""" Saves a tractogram to a file.
100100
101101
Parameters
102102
----------

nibabel/streamlines/tractogram.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def is_lazy_dict(obj):
2020

2121

2222
class SliceableDataDict(MutableMapping):
23-
""" Dictionary for which key access can do slicing on the values.
23+
r""" Dictionary for which key access can do slicing on the values.
2424
2525
This container behaves like a standard dictionary but extends key access to
2626
allow keys for key access to be indices slicing into the contained ndarray
@@ -73,7 +73,7 @@ def __len__(self):
7373

7474

7575
class PerArrayDict(SliceableDataDict):
76-
""" Dictionary for which key access can do slicing on the values.
76+
r""" Dictionary for which key access can do slicing on the values.
7777
7878
This container behaves like a standard dictionary but extends key access to
7979
allow keys for key access to be indices slicing into the contained ndarray

0 commit comments

Comments
 (0)