Skip to content

Commit fe7d97c

Browse files
STY: Apply ruff/pyupgrade rule UP032
UP032 Use f-string instead of `format` call
1 parent 4c784a7 commit fe7d97c

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

nibabel/cmdline/dicomfs.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,7 @@ def release(self, path, flags, fh):
193193
def get_opt_parser():
194194
# use module docstring for help output
195195
p = OptionParser(
196-
usage='{} [OPTIONS] <DIRECTORY CONTAINING DICOMSs> <mount point>'.format(
197-
os.path.basename(sys.argv[0])
198-
),
196+
usage=f'{os.path.basename(sys.argv[0])} [OPTIONS] <DIRECTORY CONTAINING DICOMSs> <mount point>',
199197
version='%prog ' + nib.__version__,
200198
)
201199

nibabel/tests/test_nifti1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ def test_slice_times(self):
538538
hdr.set_slice_duration(0.1)
539539
# We need a function to print out the Nones and floating point
540540
# values in a predictable way, for the tests below.
541-
_stringer = lambda val: val is not None and '{:2.1f}'.format(val) or None
541+
_stringer = lambda val: val is not None and f'{val:2.1f}' or None
542542
_print_me = lambda s: list(map(_stringer, s))
543543
# The following examples are from the nifti1.h documentation.
544544
hdr['slice_code'] = slice_order_codes['sequential increasing']

0 commit comments

Comments
 (0)