Skip to content

Commit 5636fe8

Browse files
committed
DOCTEST: Normalize whitespace for numpy > 1.13.1
1 parent 9b8c4d9 commit 5636fe8

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

nibabel/affines.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def append_diag(aff, steps, starts=()):
205205
--------
206206
>>> aff = np.eye(4)
207207
>>> aff[:3,:3] = np.arange(9).reshape((3,3))
208-
>>> append_diag(aff, [9, 10], [99,100])
208+
>>> append_diag(aff, [9, 10], [99,100]) #doctest: +NORMALIZE_WHITESPACE
209209
array([[ 0., 1., 2., 0., 0., 0.],
210210
[ 3., 4., 5., 0., 0., 0.],
211211
[ 6., 7., 8., 0., 0., 0.],

nibabel/casting.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ def int_abs(arr):
587587
128
588588
>>> int_abs(np.array([-128, 127], dtype=np.int8))
589589
array([128, 127], dtype=uint8)
590-
>>> int_abs(np.array([-128, 127], dtype=np.float32))
590+
>>> int_abs(np.array([-128, 127], dtype=np.float32)) #doctest: +NORMALIZE_WHITESPACE
591591
array([ 128., 127.], dtype=float32)
592592
"""
593593
arr = np.array(arr, copy=False)

nibabel/nicom/dwiparams.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def nearest_pos_semi_def(B):
8888
Examples
8989
--------
9090
>>> B = np.diag([1, 1, -1])
91-
>>> nearest_pos_semi_def(B)
91+
>>> nearest_pos_semi_def(B) #doctest: +NORMALIZE_WHITESPACE
9292
array([[ 0.75, 0. , 0. ],
9393
[ 0. , 0.75, 0. ],
9494
[ 0. , 0. , 0. ]])
@@ -145,11 +145,11 @@ def q2bg(q_vector, tol=1e-5):
145145
146146
Examples
147147
--------
148-
>>> q2bg([1, 0, 0])
148+
>>> q2bg([1, 0, 0]) #doctest: +NORMALIZE_WHITESPACE
149149
(1.0, array([ 1., 0., 0.]))
150-
>>> q2bg([0, 10, 0])
150+
>>> q2bg([0, 10, 0]) #doctest: +NORMALIZE_WHITESPACE
151151
(10.0, array([ 0., 1., 0.]))
152-
>>> q2bg([0, 0, 0])
152+
>>> q2bg([0, 0, 0]) #doctest: +NORMALIZE_WHITESPACE
153153
(0.0, array([ 0., 0., 0.]))
154154
"""
155155
q_vec = np.asarray(q_vector)

nibabel/nifti1.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1938,13 +1938,13 @@ def set_sform(self, affine, code=None, **kwargs):
19381938
>>> data = np.arange(24).reshape((2,3,4))
19391939
>>> aff = np.diag([2, 3, 4, 1])
19401940
>>> img = Nifti1Pair(data, aff)
1941-
>>> img.get_sform()
1941+
>>> img.get_sform() #doctest: +NORMALIZE_WHITESPACE
19421942
array([[ 2., 0., 0., 0.],
19431943
[ 0., 3., 0., 0.],
19441944
[ 0., 0., 4., 0.],
19451945
[ 0., 0., 0., 1.]])
19461946
>>> saff, code = img.get_sform(coded=True)
1947-
>>> saff
1947+
>>> saff #doctest: +NORMALIZE_WHITESPACE
19481948
array([[ 2., 0., 0., 0.],
19491949
[ 0., 3., 0., 0.],
19501950
[ 0., 0., 4., 0.],

nibabel/quaternions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -465,13 +465,13 @@ def quat2angle_axis(quat, identity_thresh=None):
465465
>>> theta, vec = quat2angle_axis([0, 1, 0, 0])
466466
>>> np.allclose(theta, np.pi)
467467
True
468-
>>> vec
468+
>>> vec #doctest: +NORMALIZE_WHITESPACE
469469
array([ 1., 0., 0.])
470470
471471
If this is an identity rotation, we return a zero angle and an
472472
arbitrary vector
473473
474-
>>> quat2angle_axis([1, 0, 0, 0])
474+
>>> quat2angle_axis([1, 0, 0, 0]) #doctest: +NORMALIZE_WHITESPACE
475475
(0.0, array([ 1., 0., 0.]))
476476
477477
Notes

nibabel/tests/test_minc1.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def test_old_namespace():
122122
# depending on whether the minc.py module is already imported in this
123123
# test run.
124124
if not previous_import:
125-
assert_equal(warns.pop(0).category, FutureWarning)
125+
assert_equal(warns.pop(0).category, DeprecationWarning)
126126
from .. import Minc1Image, MincImage
127127
assert_equal(warns, [])
128128
# The import from old module is the same as that from new

0 commit comments

Comments
 (0)