Skip to content

Commit 7af53d2

Browse files
MNT: Add flake8-logging-format (G) rules to ruff
1 parent e9a5bfc commit 7af53d2

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
@@ -367,7 +367,8 @@ def get_world_pedir(ornt, pe_direction):
367367
if flip[not inv].startswith(axcode):
368368
return '-'.join(flip)
369369
LOGGER.warning(
370-
'Cannot determine world direction of phase encoding. '
371-
f'Orientation: {ornt}; PE dir: {pe_direction}'
370+
'Cannot determine world direction of phase encoding. Orientation: %s; PE dir: %s',
371+
ornt,
372+
pe_direction,
372373
)
373374
return 'Could not be determined - assuming Anterior-Posterior'

fmriprep/workflows/bold/stc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def init_bold_stc_wf(
114114
inputnode = pe.Node(niu.IdentityInterface(fields=['bold_file', 'skip_vols']), name='inputnode')
115115
outputnode = pe.Node(niu.IdentityInterface(fields=['stc_file']), name='outputnode')
116116

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

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

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ extend-select = [
157157
# "EM",
158158
"EXE",
159159
"FA",
160+
"G",
160161
"ISC",
161162
"ICN",
162163
"PT",

0 commit comments

Comments
 (0)