Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT: Add flake8-logging-format (G) rules to ruff #3242

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fmriprep/_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _warn(message, category=None, stacklevel=1, source=None):
category = type(category).__name__
category = category.replace('type', 'WARNING')

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


def _showwarning(message, category, filename, lineno, file=None, line=None):
Expand Down
5 changes: 3 additions & 2 deletions fmriprep/interfaces/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ def get_world_pedir(ornt, pe_direction):
if flip[not inv].startswith(axcode):
return '-'.join(flip)
LOGGER.warning(
'Cannot determine world direction of phase encoding. '
f'Orientation: {ornt}; PE dir: {pe_direction}'
'Cannot determine world direction of phase encoding. Orientation: %s; PE dir: %s',
ornt,
pe_direction,
)
return 'Could not be determined - assuming Anterior-Posterior'
2 changes: 1 addition & 1 deletion fmriprep/workflows/bold/stc.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def init_bold_stc_wf(
inputnode = pe.Node(niu.IdentityInterface(fields=['bold_file', 'skip_vols']), name='inputnode')
outputnode = pe.Node(niu.IdentityInterface(fields=['stc_file']), name='outputnode')

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

# It would be good to fingerprint memory use of afni.TShift
slice_timing_correction = pe.Node(
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ extend-select = [
# "EM",
"EXE",
"FA",
"G",
"ISC",
"ICN",
"PT",
Expand Down
Loading