Skip to content

Commit e53db3d

Browse files
committed
Merge remote-tracking branch 'upstream/maint/3.2.x'
2 parents 591a1bd + a84b203 commit e53db3d

21 files changed

+79
-61
lines changed

.travis.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ env:
1616
- DEPENDS="numpy scipy matplotlib h5py pillow pydicom indexed_gzip"
1717
- INSTALL_TYPE="setup"
1818
- CHECK_TYPE="test"
19-
- EXTRA_WHEELS="https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com"
2019
- NIGHTLY_WHEELS="https://pypi.anaconda.org/scipy-wheels-nightly/simple"
21-
- EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS"
22-
- PRE_PIP_FLAGS="--pre $EXTRA_PIP_FLAGS --extra-index-url $NIGHTLY_WHEELS"
20+
- PRE_PIP_FLAGS="--pre --extra-index-url $NIGHTLY_WHEELS"
2321

2422
python:
2523
- 3.7
@@ -30,7 +28,7 @@ jobs:
3028
- arch: arm64
3129
python: 3.6
3230
env:
33-
- DEPENDS="numpy"
31+
- DEPENDS="numpy scipy pillow pydicom"
3432
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
3533
# Basic dependencies only
3634
- python: 3.6
@@ -62,6 +60,11 @@ jobs:
6260
- python: 3.8
6361
env:
6462
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
63+
# test 3.9 against pre-release builds of dependencies that support it
64+
- python: 3.9
65+
env:
66+
- DEPENDS="numpy scipy h5py pillow pydicom"
67+
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
6568
# OSX Python support is basically accidental. Take whatever version we can
6669
# get and test with full dependencies...
6770
- os: osx

.zenodo.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@
171171
"orcid": "0000-0003-4662-0558"
172172
},
173173
{
174-
"name": "Klug, Julian"
174+
"affiliation": "University of Geneva, Switzerland",
175+
"name": "Klug, Julian",
176+
"orcid": "0000-0002-4849-9811"
175177
},
176178
{
177179
"affiliation": "SRI International",

Changelog

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,20 @@ Eric Larson (EL), Demian Wassermann, Stephan Gerhard and Ross Markello (RM).
2525

2626
References like "pr/298" refer to github pull request numbers.
2727

28+
3.2.1 (Saturday 28 November 2020)
29+
=================================
30+
31+
Bug fix release in the 3.2.x series.
32+
33+
Maintenance
34+
-----------
35+
* Drop references to builtin types in Numpy namespace like ``np.float``
36+
(pr/964) (EL, reviewed by CM)
37+
* Ensure compatibility with Python 3.9 (pr/963) (CM)
38+
39+
2840
3.2.0 (Tuesday 20 October 2020)
29-
==============================
41+
===============================
3042

3143
New feature release in the 3.2.x series.
3244

doc/source/old/ioimplementation.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ By use case.
101101
>>> mod_data[0,0] = 99
102102
>>> np.all(img4.data = mod_data)
103103
True
104-
104+
105105
Prepare image for later writing
106106

107-
>>> img5 = Image(np.zeros(2,3,4))
107+
>>> img5 = Image(np.zeros(2,3,4))
108108
>>> fp, fname2 = tempfile.mkstemp('.nii')
109109
>>> img5.set_filespec(fname2)
110110
>>> # then do some things to the image
@@ -115,7 +115,7 @@ By use case.
115115
>>> from nibabel.ioimps import guessed_imp
116116
>>> fp, fname3 = tempfile.mkstemp('.nii')
117117
>>> ioimp = guessed_imp(fname3)
118-
>>> ioimp.set_data_dtype(np.float)
118+
>>> ioimp.set_data_dtype(np.float64)
119119
>>> ioimp.set_data_shape((2,3,4)) # set_data_shape method
120120
>>> slice_def = (slice(None), slice(None), 0)
121121
>>> ioimp.write_slice(data[slice_def], slice_def) # write_slice method
@@ -124,6 +124,3 @@ By use case.
124124
Traceback (most recent call last):
125125
...
126126
ImageIOError: data write is not contiguous
127-
128-
129-

nibabel/benchmarks/bench_arrayproxy_slicing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
('?', '?', '?', ':'),
4747
]
4848

49-
KEEP_OPENS = [False, True, 'auto']
49+
KEEP_OPENS = [False, True]
5050

5151
if HAVE_INDEXED_GZIP:
5252
HAVE_IGZIP = [False, True]

nibabel/cifti2/parse_cifti2.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,28 +517,28 @@ def flush_chardata(self):
517517
# conversion to numpy array
518518
c = BytesIO(data.strip().encode('utf-8'))
519519
vertices = self.struct_state[-1]
520-
vertices.extend(np.loadtxt(c, dtype=np.int, ndmin=1))
520+
vertices.extend(np.loadtxt(c, dtype=int, ndmin=1))
521521
c.close()
522522

523523
elif self.write_to == 'VoxelIndices':
524524
# conversion to numpy array
525525
c = BytesIO(data.strip().encode('utf-8'))
526526
parent = self.struct_state[-1]
527-
parent.voxel_indices_ijk.extend(np.loadtxt(c, dtype=np.int).reshape(-1, 3))
527+
parent.voxel_indices_ijk.extend(np.loadtxt(c, dtype=int).reshape(-1, 3))
528528
c.close()
529529

530530
elif self.write_to == 'VertexIndices':
531531
# conversion to numpy array
532532
c = BytesIO(data.strip().encode('utf-8'))
533533
index = self.struct_state[-1]
534-
index.extend(np.loadtxt(c, dtype=np.int, ndmin=1))
534+
index.extend(np.loadtxt(c, dtype=int, ndmin=1))
535535
c.close()
536536

537537
elif self.write_to == 'TransformMatrix':
538538
# conversion to numpy array
539539
c = BytesIO(data.strip().encode('utf-8'))
540540
transform = self.struct_state[-1]
541-
transform.matrix = np.loadtxt(c, dtype=np.float)
541+
transform.matrix = np.loadtxt(c, dtype=np.float64)
542542
c.close()
543543

544544
elif self.write_to == 'Label':

nibabel/externals/netcdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class netcdf_file(object):
219219
220220
>>> data = time[:]
221221
>>> data.base.base # doctest: +ELLIPSIS
222-
<mmap.mmap object at 0x...>
222+
<mmap.mmap ...>
223223
224224
If the data is to be processed after the file is closed, it needs
225225
to be copied to main memory:

nibabel/freesurfer/io.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def _fread3_many(fobj, n):
4949
An array of 3 byte int
5050
"""
5151
b1, b2, b3 = np.fromfile(fobj, ">u1", 3 * n).reshape(-1,
52-
3).astype(np.int).T
52+
3).astype(int).T
5353
return (b1 << 16) + (b2 << 8) + b3
5454

5555

@@ -148,14 +148,14 @@ def read_geometry(filepath, read_metadata=False, read_stamp=False):
148148
nvert = _fread3(fobj)
149149
nquad = _fread3(fobj)
150150
(fmt, div) = (">i2", 100.) if magic == QUAD_MAGIC else (">f4", 1.)
151-
coords = np.fromfile(fobj, fmt, nvert * 3).astype(np.float) / div
151+
coords = np.fromfile(fobj, fmt, nvert * 3).astype(np.float64) / div
152152
coords = coords.reshape(-1, 3)
153153
quads = _fread3_many(fobj, nquad * 4)
154154
quads = quads.reshape(nquad, 4)
155155
#
156156
# Face splitting follows
157157
#
158-
faces = np.zeros((2 * nquad, 3), dtype=np.int)
158+
faces = np.zeros((2 * nquad, 3), dtype=int)
159159
nface = 0
160160
for quad in quads:
161161
if (quad[0] % 2) == 0:
@@ -182,7 +182,7 @@ def read_geometry(filepath, read_metadata=False, read_stamp=False):
182182
else:
183183
raise ValueError("File does not appear to be a Freesurfer surface")
184184

185-
coords = coords.astype(np.float) # XXX: due to mayavi bug on mac 32bits
185+
coords = coords.astype(np.float64) # XXX: due to mayavi bug on mac 32bits
186186

187187
ret = (coords, faces)
188188
if read_metadata:
@@ -589,7 +589,7 @@ def read_label(filepath, read_scalars=False):
589589
Only returned if `read_scalars` is True. Array of scalar data for each
590590
vertex.
591591
"""
592-
label_array = np.loadtxt(filepath, dtype=np.int, skiprows=2, usecols=[0])
592+
label_array = np.loadtxt(filepath, dtype=int, skiprows=2, usecols=[0])
593593
if read_scalars:
594594
scalar_array = np.loadtxt(filepath, skiprows=2, usecols=[-1])
595595
return label_array, scalar_array

nibabel/freesurfer/tests/test_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def test_write_morph_data():
157157
with pytest.raises(ValueError):
158158
write_morph_data('test.curv', np.zeros(shape), big_num)
159159
# Windows 32-bit overflows Python int
160-
if np.dtype(np.int) != np.dtype(np.int32):
160+
if np.dtype(int) != np.dtype(np.int32):
161161
with pytest.raises(ValueError):
162162
write_morph_data('test.curv', strided_scalar((big_num,)))
163163
for shape in bad_shapes:

nibabel/minc1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def _get_valid_range(self):
137137
if valid_range[0] < info.min or valid_range[1] > info.max:
138138
raise ValueError('Valid range outside input '
139139
'data type range')
140-
return np.asarray(valid_range, dtype=np.float)
140+
return np.asarray(valid_range, dtype=np.float64)
141141

142142
def _get_scalar(self, var):
143143
""" Get scalar value from NetCDF scalar """

0 commit comments

Comments
 (0)