Skip to content

Commit

Permalink
Merge pull request #1360 from DimitriPapadopoulos/FLY
Browse files Browse the repository at this point in the history
STY: Enforce ruff/flynt rules (FLY)
  • Loading branch information
effigies authored Sep 24, 2024
2 parents c742552 + 27baa68 commit 276f786
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion nibabel/batteryrunners.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def __str__(self):
def message(self):
"""formatted message string, including fix message if present"""
if self.fix_msg:
return '; '.join((self.problem_msg, self.fix_msg))
return f'{self.problem_msg}; {self.fix_msg}'
return self.problem_msg

def log_raise(self, logger, error_level=40):
Expand Down
2 changes: 1 addition & 1 deletion nibabel/gifti/gifti.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def _to_xml_element(self):
def print_summary(self):
print('Dataspace: ', xform_codes.niistring[self.dataspace])
print('XFormSpace: ', xform_codes.niistring[self.xformspace])
print('Affine Transformation Matrix: \n', self.xform)
print('Affine Transformation Matrix:\n', self.xform)


def _data_tag_element(dataarray, encoding, dtype, ordering):
Expand Down
15 changes: 8 additions & 7 deletions nibabel/gifti/tests/test_gifti.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,13 +423,14 @@ def test_gifti_coord(capsys):
gcs.xform = None
gcs.print_summary()
captured = capsys.readouterr()
assert captured.out == '\n'.join(
[
'Dataspace: NIFTI_XFORM_UNKNOWN',
'XFormSpace: NIFTI_XFORM_UNKNOWN',
'Affine Transformation Matrix: ',
' None\n',
]
assert (
captured.out
== """\
Dataspace: NIFTI_XFORM_UNKNOWN
XFormSpace: NIFTI_XFORM_UNKNOWN
Affine Transformation Matrix:
None
"""
)
gcs.to_xml()

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ select = [
"B",
"C4",
"F",
"FLY",
"FURB",
"I",
"PIE",
Expand Down

0 comments on commit 276f786

Please sign in to comment.