Skip to content

Commit 5b037c3

Browse files
committed
Merge pull request #142 from matthew-brett/win7-64-doctest-fixes
TST: fix failing doctests on windows 64 bit It seems that on windows 64 bit, Christophe Gohlke binaries, numpy shape values come out as Long objects rather than python ints.
2 parents 9fb39b7 + 236f027 commit 5b037c3

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

nibabel/analyze.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -962,11 +962,11 @@ def update_header(self):
962962
>>> affine = np.diag([1.0,2.0,3.0,1.0])
963963
>>> img = AnalyzeImage(data, affine)
964964
>>> hdr = img.get_header()
965-
>>> img.shape
966-
(2, 3, 4)
965+
>>> img.shape == (2, 3, 4)
966+
True
967967
>>> img.update_header()
968-
>>> hdr.get_data_shape()
969-
(2, 3, 4)
968+
>>> hdr.get_data_shape() == (2, 3, 4)
969+
True
970970
>>> hdr.get_zooms()
971971
(1.0, 2.0, 3.0)
972972
'''

nibabel/ecat.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -797,11 +797,11 @@ def __init__(self, data, affine, header,
797797
>>> ecat_file = os.path.join(nibabel_dir,'tests','data','tinypet.v')
798798
>>> img = ecat.load(ecat_file)
799799
>>> frame0 = img.get_frame(0)
800-
>>> frame0.shape
801-
(10, 10, 3)
800+
>>> frame0.shape == (10, 10, 3)
801+
True
802802
>>> data4d = img.get_data()
803-
>>> data4d.shape
804-
(10, 10, 3, 1)
803+
>>> data4d.shape == (10, 10, 3, 1)
804+
True
805805
"""
806806
self._subheader = subheader
807807
self._mlist = mlist

nibabel/eulerangles.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ def euler2mat(z=0, y=0, x=0):
116116
>>> yrot = -0.1
117117
>>> xrot = 0.2
118118
>>> M = euler2mat(zrot, yrot, xrot)
119-
>>> M.shape
120-
(3, 3)
119+
>>> M.shape == (3, 3)
120+
True
121121
122122
The output rotation matrix is equal to the composition of the
123123
individual rotations

nibabel/externals/netcdf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@
122122
>>> time = f.variables['time']
123123
>>> time.units #23dt next : bytes
124124
'days since 2008-01-01'
125-
>>> print time.shape
126-
(10,)
125+
>>> time.shape == (10,)
126+
True
127127
>>> print time[-1]
128128
9
129129
>>> f.close()

nibabel/funcs.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,33 +39,33 @@ def squeeze_image(img):
3939
>>> data = np.arange(np.prod(shape)).reshape(shape)
4040
>>> affine = np.eye(4)
4141
>>> img = nf.Nifti1Image(data, affine)
42-
>>> img.shape
43-
(10, 20, 30, 1, 1)
42+
>>> img.shape == (10, 20, 30, 1, 1)
43+
True
4444
>>> img2 = squeeze_image(img)
45-
>>> img2.shape
46-
(10, 20, 30)
45+
>>> img2.shape == (10, 20, 30)
46+
True
4747
4848
If the data are 3D then last dimensions of 1 are ignored
4949
5050
>>> shape = (10,1,1)
5151
>>> data = np.arange(np.prod(shape)).reshape(shape)
5252
>>> img = nf.ni1.Nifti1Image(data, affine)
53-
>>> img.shape
54-
(10, 1, 1)
53+
>>> img.shape == (10, 1, 1)
54+
True
5555
>>> img2 = squeeze_image(img)
56-
>>> img2.shape
57-
(10, 1, 1)
56+
>>> img2.shape == (10, 1, 1)
57+
True
5858
5959
Only *final* dimensions of 1 are squeezed
6060
6161
>>> shape = (1, 1, 5, 1, 2, 1, 1)
6262
>>> data = data.reshape(shape)
6363
>>> img = nf.ni1.Nifti1Image(data, affine)
64-
>>> img.shape
65-
(1, 1, 5, 1, 2, 1, 1)
64+
>>> img.shape == (1, 1, 5, 1, 2, 1, 1)
65+
True
6666
>>> img2 = squeeze_image(img)
67-
>>> img2.shape
68-
(1, 1, 5, 1, 2)
67+
>>> img2.shape == (1, 1, 5, 1, 2)
68+
True
6969
'''
7070
klass = img.__class__
7171
shape = img.shape

0 commit comments

Comments
 (0)