Skip to content

Commit b9232f4

Browse files
STY: Apply ruff/flake8-logging-format rule G004
G004 Logging statement uses f-string
1 parent 394f507 commit b9232f4

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

fmriprep/_warnings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def _warn(message, category=None, stacklevel=1, source=None):
3535
category = type(category).__name__
3636
category = category.replace('type', 'WARNING')
3737

38-
logging.getLogger('py.warnings').warning(f'{category or "WARNING"}: {message}')
38+
logging.getLogger('py.warnings').warning('%s: %s', category or 'WARNING', message)
3939

4040

4141
def _showwarning(message, category, filename, lineno, file=None, line=None):

fmriprep/interfaces/reports.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,8 @@ def get_world_pedir(ornt, pe_direction):
372372
if flip[not inv].startswith(axcode):
373373
return '-'.join(flip)
374374
LOGGER.warning(
375-
'Cannot determine world direction of phase encoding. '
376-
f'Orientation: {ornt}; PE dir: {pe_direction}'
375+
'Cannot determine world direction of phase encoding. Orientation: %s; PE dir: %s',
376+
ornt,
377+
pe_direction,
377378
)
378379
return 'Could not be determined - assuming Anterior-Posterior'

fmriprep/workflows/bold/stc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def init_bold_stc_wf(
115115
inputnode = pe.Node(niu.IdentityInterface(fields=['bold_file', 'skip_vols']), name='inputnode')
116116
outputnode = pe.Node(niu.IdentityInterface(fields=['stc_file']), name='outputnode')
117117

118-
LOGGER.log(25, f'BOLD series will be slice-timing corrected to an offset of {tzero:.3g}s.')
118+
LOGGER.log(25, 'BOLD series will be slice-timing corrected to an offset of %.3gs.', tzero)
119119

120120
# It would be good to fingerprint memory use of afni.TShift
121121
slice_timing_correction = pe.Node(

0 commit comments

Comments
 (0)