Skip to content

Performed changes to listed warn() and logger.info - #13530

Open
salmanbl377 wants to merge 8 commits into
mne-tools:mainfrom
salmanbl377:main
Open

salmanbl377 wants to merge 8 commits into
mne-tools:mainfrom
salmanbl377:main

Conversation

@salmanbl377

Copy link
Copy Markdown

/logger.debug as listed in POSSEE
Conducted changes to non-logging messages using
grep calls in POSSEE document, many were false
positive. actual changes listed below.

Reference issue (if any)

What does this implement/fix?

Additional information

/logger.debug as listed in POSSEE
Conducted changes to non-logging messages using
grep calls in POSSEE document, many were false
positive. actual changes listed below.
@welcome

welcome Bot commented Dec 5, 2025

Copy link
Copy Markdown

Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴

Comment thread mne/cov.py
return cov

logger.info(" Did not find the desired covariance matrix (kind = %d)", cov_kind)
logger.info(f" Did not find the desired covariance matrix (kind = {cov_kind})")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one I think was okay in main. These are logging.logger calls so delayed repr calls using % and *args can be useful

Comment thread mne/_fiff/meas_info.py Outdated
# This shouldn't happen if we're up to date with the FIFF
# spec
warn(f"Discarding extra channel information kind {kind}")
warn("Discarding extra channel information kind %s" % (kind,))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@drammock I think these we probably don't want to change... our warn function is really a wrapper around warnings.warn which doesn't use *args or delayed % formatting

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we only want % for errors and for logger.info and logger.debug, but not for warn()?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's the idea

@salmanbl377

Copy link
Copy Markdown
Author

@larsoner i will push commits to fix style next

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants