Skip to content

Commit 919b764

Browse files
MNT: Add flake8-logging-format (G) rules to ruff
1 parent 3e69454 commit 919b764

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

fmriprep/_warnings.py

+1-1
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

+3-2
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,8 @@ def get_world_pedir(ornt, pe_direction):
365365
if flip[not inv].startswith(axcode):
366366
return '-'.join(flip)
367367
LOGGER.warning(
368-
'Cannot determine world direction of phase encoding. '
369-
f'Orientation: {ornt}; PE dir: {pe_direction}'
368+
'Cannot determine world direction of phase encoding. Orientation: %s; PE dir: %s',
369+
ornt,
370+
pe_direction,
370371
)
371372
return 'Could not be determined - assuming Anterior-Posterior'

fmriprep/workflows/bold/stc.py

+1-1
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(

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ extend-select = [
170170
# "EM",
171171
"EXE",
172172
"FA",
173+
"G",
173174
"ISC",
174175
"ICN",
175176
"PT",

0 commit comments

Comments
 (0)