Skip to content

Commit dab6331

Browse files
committed
DOCTEST: Split testsetup from module docstrings
1 parent a2bc501 commit dab6331

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

nibabel/affines.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
22
# vi: set ft=python sts=4 ts=4 sw=4 et:
33
""" Utility routines for working with points and affine transforms
4-
4+
"""
5+
"""
56
.. testsetup::
67
78
>>> from distutils.version import LooseVersion

nibabel/casting.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
33
Most routines work round some numpy oddities in floating point precision and
44
casting. Others work round numpy casting to and from python ints
5-
5+
"""
6+
"""
67
.. testsetup::
78
89
>>> from distutils.version import LooseVersion

nibabel/nicom/dwiparams.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
``q_est`` is the closest q vector equivalent to the B matrix, then:
1818
1919
B ~ (q_est . q_est.T) / norm(q_est)
20-
20+
'''
21+
'''
2122
.. testsetup::
2223
2324
>>> from distutils.version import LooseVersion

nibabel/nifti1.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@
99
''' Read / write access to NIfTI1 image format
1010
1111
NIfTI1 format defined at http://nifti.nimh.nih.gov/nifti-1/
12-
13-
.. testsetup::
14-
15-
>>> from distutils.version import LooseVersion
16-
>>> if LooseVersion(np.__version__) > LooseVersion('1.13.1'):
17-
... np.set_printoptions(sign='legacy')
1812
'''
1913
from __future__ import division, print_function
2014
import warnings
@@ -33,6 +27,13 @@
3327
from .spm99analyze import SpmAnalyzeHeader
3428
from .casting import have_binary128
3529
from .pydicom_compat import have_dicom, pydicom as pdcm
30+
'''
31+
.. testsetup::
32+
33+
>>> from distutils.version import LooseVersion
34+
>>> if LooseVersion(np.__version__) > LooseVersion('1.13.1'):
35+
... np.set_printoptions(sign='legacy')
36+
'''
3637

3738
# nifti1 flat header definition for Analyze-like first 348 bytes
3839
# first number in comments indicates offset in file header in bytes

nibabel/quaternions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
>>> M = quat2mat(q) # from this module
2424
>>> vec = np.array([1, 2, 3]).reshape((3,1)) # column vector
2525
>>> tvec = np.dot(M, vec)
26-
26+
'''
27+
'''
2728
.. testsetup::
2829
2930
>>> from distutils.version import LooseVersion

0 commit comments

Comments
 (0)