Skip to content

Commit c842d84

Browse files
STY: Apply ruff preview rule RUF031
RUF031 Avoid parentheses for tuples in subscripts.
1 parent 21f3324 commit c842d84

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

nibabel/minc1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def get_data_dtype(self):
8080
dtt = np.dtype(np.float64)
8181
else:
8282
signtype = self._image.signtype.decode('latin-1')
83-
dtt = _dt_dict[(typecode, signtype)]
83+
dtt = _dt_dict[typecode, signtype]
8484
return np.dtype(dtt).newbyteorder('>')
8585

8686
def get_data_shape(self):

nibabel/nicom/csareader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def get_csa_header(dcm_data, csa_type='image'):
6363
return None
6464
element_no = section_start + element_offset
6565
try:
66-
tag = dcm_data[(0x29, element_no)]
66+
tag = dcm_data[0x29, element_no]
6767
except KeyError:
6868
# The element could be missing due to anonymization
6969
return None

nibabel/nicom/tests/test_csareader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_csa_header_read():
3535
data2.add(element)
3636
assert csa.get_csa_header(data2, 'image') is None
3737
# Add back the marker - CSA works again
38-
data2[(0x29, 0x10)] = DATA[(0x29, 0x10)]
38+
data2[0x29, 0x10] = DATA[0x29, 0x10]
3939
assert csa.is_mosaic(csa.get_csa_header(data2, 'image'))
4040

4141

0 commit comments

Comments
 (0)