Skip to content

Commit 3d778c2

Browse files
committed
Work around Numpy formatting glitch in doctest
A Numpy string formatting bug causes this doctest to fail on certain 32-bit platforms (e.g. armhf). The bug is evident in the following example: >>> np.arange(8) array([0, 1, 2, 3, 4, 5, 6, 7]) >>> 1 << np.arange(8) array([ 1, 2, 4, 8, 16, 32, 64, 128], dtype=int32) The `dtype=int32` should be supressed in both cases, but it is not. This might get fixed upstream in Numpy 1.17. See numpy/numpy#9799, numpy/numpy#10151.
1 parent d31d53d commit 3d778c2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎healpy/pixelfunc.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,8 +1139,8 @@ def order2nside(order):
11391139
>>> hp.order2nside(7)
11401140
128
11411141
1142-
>>> hp.order2nside(np.arange(8))
1143-
array([ 1, 2, 4, 8, 16, 32, 64, 128])
1142+
>>> print(hp.order2nside(np.arange(8)))
1143+
[ 1 2 4 8 16 32 64 128]
11441144
11451145
>>> hp.order2nside(31)
11461146
Traceback (most recent call last):

0 commit comments

Comments
 (0)