Skip to content

Commit 274a6ce

Browse files
committed
DOCTEST: Use legacy float array printing for now
1 parent 9b8c4d9 commit 274a6ce

File tree

5 files changed

+29
-0
lines changed

5 files changed

+29
-0
lines changed

nibabel/affines.py

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
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+
5+
.. testsetup::
6+
7+
>>> from distutils.version import LooseVersion
8+
>>> if LooseVersion(np.__version__) > LooseVersion('1.13.1'):
9+
... np.set_printoptions(sign='legacy')
410
"""
511

612
import numpy as np

nibabel/casting.py

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
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+
6+
.. testsetup::
7+
8+
>>> from distutils.version import LooseVersion
9+
>>> if LooseVersion(np.__version__) > LooseVersion('1.13.1'):
10+
... np.set_printoptions(sign='legacy')
511
"""
612

713
from numbers import Integral

nibabel/nicom/dwiparams.py

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
1919
B ~ (q_est . q_est.T) / norm(q_est)
2020
21+
.. testsetup::
22+
23+
>>> from distutils.version import LooseVersion
24+
>>> if LooseVersion(np.__version__) > LooseVersion('1.13.1'):
25+
... np.set_printoptions(sign='legacy')
2126
'''
2227
import numpy as np
2328
import numpy.linalg as npl

nibabel/nifti1.py

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
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')
1218
'''
1319
from __future__ import division, print_function
1420
import warnings

nibabel/quaternions.py

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
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+
27+
.. testsetup::
28+
29+
>>> from distutils.version import LooseVersion
30+
>>> if LooseVersion(np.__version__) > LooseVersion('1.13.1'):
31+
... np.set_printoptions(sign='legacy')
2632
'''
2733

2834
import math

0 commit comments

Comments
 (0)