8000 Merge pull request #1304 from effigies/fix/array-copy · nipy/nibabel@d1e89ac · GitHub
[go: up one dir, main page]

Skip to content

Commit d1e89ac

Browse files
authored
Merge pull request #1304 from effigies/fix/array-copy
FIX: Use np.asarray instead of np.array(..., copy=False)
2 parents e4facc1 + 2bad8cc commit d1e89ac

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

nibabel/affines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ def rescale_affine(affine, shape, zooms, new_shape=None):
365365
A new affine transform with the specified voxel sizes
366366
367367
"""
368-
shape = np.array(shape, copy=False)
368+
shape = np.asarray(shape)
369369
new_shape = np.array(new_shape if new_shape is not None else shape)
370370

371371
s = voxel_sizes(affine)

nibabel/casting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ def int_abs(arr):
611611
>>> int_abs(np.array([-128, 127], dtype=np.float32))
612612
array([128., 127.], dtype=float32)
613613
"""
614-
arr = np.array(arr, copy=False)
614+
arr = np.asarray(arr)
615615
dt = arr.dtype
616616
if dt.kind == 'u':
617617
return arr

0 commit comments

Comments
 (0)
0