Skip to content
Snippets Groups Projects
Commit 4e63aac4 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

MNT: Use %-formatting in log calls

parent bad9585c
No related branches found
No related tags found
No related merge requests found
...@@ -469,10 +469,10 @@ class Nifti(notifier.Notifier, meta.Meta): ...@@ -469,10 +469,10 @@ class Nifti(notifier.Notifier, meta.Meta):
self.__worldToVoxMat = transform.invert(self.__voxToWorldMat) self.__worldToVoxMat = transform.invert(self.__voxToWorldMat)
log.debug('Affine changed:\npixdims: ' log.debug('Affine changed:\npixdims: '
'{}\nsform: {}\nqform: {}'.format( '%s\nsform: %s\nqform: %s',
header.get_zooms(), header.get_zooms(),
header.get_sform(), header.get_sform(),
header.get_qform())) header.get_qform())
self.notify(topic='transform') self.notify(topic='transform')
...@@ -1080,13 +1080,13 @@ class Image(Nifti): ...@@ -1080,13 +1080,13 @@ class Image(Nifti):
# If an image size threshold has not been specified, # If an image size threshold has not been specified,
# then we'll calculate the full data range right now. # then we'll calculate the full data range right now.
if sizethres is None or nbytes < sizethres: if sizethres is None or nbytes < sizethres:
log.debug('{}: Forcing calculation of full ' log.debug('%s: Forcing calculation of full '
'data range'.format(self.name)) 'data range', self.name)
self.__imageWrapper[:] self.__imageWrapper[:]
else: else:
log.debug('{}: Calculating data range ' log.debug('%s: Calculating data range '
'from sample'.format(self.name)) 'from sample', self.name)
# Otherwise if the number of values in the # Otherwise if the number of values in the
# image is bigger than the size threshold, # image is bigger than the size threshold,
...@@ -1118,7 +1118,7 @@ class Image(Nifti): ...@@ -1118,7 +1118,7 @@ class Image(Nifti):
if not looksLikeImage(filename): if not looksLikeImage(filename):
filename = addExt(filename, mustExist=False) filename = addExt(filename, mustExist=False)
log.debug('Saving {} to {}'.format(self.name, filename)) log.debug('Saving %s to %s', self.name, filename)
# We save the image out to a temp file, # We save the image out to a temp file,
# then close the old image, move the # then close the old image, move the
...@@ -1262,7 +1262,7 @@ class Image(Nifti): ...@@ -1262,7 +1262,7 @@ class Image(Nifti):
:arg sliceobj: Something which can slice the image data. :arg sliceobj: Something which can slice the image data.
""" """
log.debug('{}: __getitem__ [{}]'.format(self.name, sliceobj)) log.debug('%s: __getitem__ [%s]', self.name, sliceobj)
return self.__imageWrapper.__getitem__(sliceobj) return self.__imageWrapper.__getitem__(sliceobj)
...@@ -1278,9 +1278,8 @@ class Image(Nifti): ...@@ -1278,9 +1278,8 @@ class Image(Nifti):
""" """
values = np.array(values) values = np.array(values)
log.debug('{}: __setitem__ [{} = {}]'.format(self.name, log.debug('%s: __setitem__ [%s = %s]',
sliceobj, self.name, sliceobj, values.shape)
values.shape))
with self.__imageWrapper.skip(self.__lName): with self.__imageWrapper.skip(self.__lName):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment