Skip to content

Commit 5d11c9e

Browse files
committed
RF: fromstring => frombuffer in gifti/cifti2
1 parent 53d9413 commit 5d11c9e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

nibabel/cifti2/tests/test_cifti2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_cifti2_metadata():
5858
assert_equal(md.data, dict(metadata_test))
5959

6060
assert_equal(list(iter(md)), list(iter(collections.OrderedDict(metadata_test))))
61-
61+
6262
md.update({'a': 'aval', 'b': 'bval'})
6363
assert_equal(md.data, dict(metadata_test))
6464

@@ -310,7 +310,7 @@ def test_matrix():
310310

311311
assert_raises(ci.Cifti2HeaderError, m.insert, 0, mim_none)
312312
assert_equal(m.mapped_indices, [])
313-
313+
314314
h = ci.Cifti2Header(matrix=m)
315315
assert_equal(m.mapped_indices, [])
316316
m.insert(0, mim_0)

nibabel/gifti/parse_gifti_fast.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def read_data_block(encoding, endian, ordering, datatype, shape, data):
4747
dec = base64.b64decode(data.encode('ascii'))
4848
dt = data_type_codes.type[datatype]
4949
sh = tuple(shape)
50-
newarr = np.fromstring(dec, dtype=dt)
50+
newarr = np.frombuffer(dec, dtype=dt)
5151
if len(newarr.shape) != len(sh):
5252
newarr = newarr.reshape(sh, order=ord)
5353

@@ -59,7 +59,7 @@ def read_data_block(encoding, endian, ordering, datatype, shape, data):
5959
zdec = zlib.decompress(dec)
6060
dt = data_type_codes.type[datatype]
6161
sh = tuple(shape)
62-
newarr = np.fromstring(zdec, dtype=dt)
62+
newarr = np.frombuffer(zdec, dtype=dt)
6363
if len(newarr.shape) != len(sh):
6464
newarr = newarr.reshape(sh, order=ord)
6565

0 commit comments

Comments
 (0)