Skip to content

Commit

Permalink
STY: Apply ruff preview rule RUF031
Browse files Browse the repository at this point in the history
RUF031 Avoid parentheses for tuples in subscripts.
  • Loading branch information
DimitriPapadopoulos committed Oct 8, 2024
1 parent fb696e4 commit 3ecea06
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nibabel/minc1.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def get_data_dtype(self):
dtt = np.dtype(np.float64)
else:
signtype = self._image.signtype.decode('latin-1')
dtt = _dt_dict[(typecode, signtype)]
dtt = _dt_dict[typecode, signtype]
return np.dtype(dtt).newbyteorder('>')

def get_data_shape(self):
Expand Down
2 changes: 1 addition & 1 deletion nibabel/nicom/csareader.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def get_csa_header(dcm_data, csa_type='image'):
return None
element_no = section_start + element_offset
try:
tag = dcm_data[(0x29, element_no)]
tag = dcm_data[0x29, element_no]
except KeyError:
# The element could be missing due to anonymization
return None
Expand Down
2 changes: 1 addition & 1 deletion nibabel/nicom/tests/test_csareader.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_csa_header_read():
data2.add(element)
assert csa.get_csa_header(data2, 'image') is None
# Add back the marker - CSA works again
data2[(0x29, 0x10)] = DATA[(0x29, 0x10)]
data2[0x29, 0x10] = DATA[0x29, 0x10]
assert csa.is_mosaic(csa.get_csa_header(data2, 'image'))


Expand Down

0 comments on commit 3ecea06

Please sign in to comment.