Skip to content

Commit 8461ef9

Browse files
MNT: [:].copy()
Apply a refurb suggestion that does make the intent clearer: [FURB145]: Replace `x[:]` with `x.copy()`
1 parent 6ba501e commit 8461ef9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

nibabel/spm2analyze.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from . import spm99analyze as spm99 # module import
1313

14-
image_dimension_dtd = spm99.image_dimension_dtd[:]
14+
image_dimension_dtd = spm99.image_dimension_dtd.copy()
1515
image_dimension_dtd[image_dimension_dtd.index(('funused2', 'f4'))] = ('scl_inter', 'f4')
1616

1717
# Full header numpy dtype combined across sub-fields

nibabel/spm99analyze.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
""" Support subtle variations of SPM version of Analyze """
2323
header_key_dtd = analyze.header_key_dtd
2424
# funused1 in dime subfield is scalefactor
25-
image_dimension_dtd = analyze.image_dimension_dtd[:]
25+
image_dimension_dtd = analyze.image_dimension_dtd.copy()
2626
image_dimension_dtd[image_dimension_dtd.index(('funused1', 'f4'))] = ('scl_slope', 'f4')
2727
# originator text field used as image origin (translations)
28-
data_history_dtd = analyze.data_history_dtd[:]
28+
data_history_dtd = analyze.data_history_dtd.copy()
2929
data_history_dtd[data_history_dtd.index(('originator', 'S10'))] = ('origin', 'i2', (5,))
3030

3131
# Full header numpy dtype combined across sub-fields

0 commit comments

Comments
 (0)