-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Performed changes to listed warn() and logger.info #13530
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
Open
salmanbl377
wants to merge
8
commits into
mne-tools:main
Choose a base branch
from
salmanbl377:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
52cf5c2
check
salmanbl377 6d30db4
Merge branch 'main' of https://github.com/salmanbl377/mne-python
salmanbl377 ce1dbf3
Merge branch 'mne-tools:main' into main
salmanbl377 2d4bc4d
Performed changes to listed warn() and logger.info
salmanbl377 7fbb2c2
Update pyproject.toml
salmanbl377 d705261
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 0072fe4
Warn back to f - string
salmanbl377 9561921
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -748,7 +748,7 @@ def compute_raw_covariance( | |
| _check_n_samples(n_samples, len(picks), on_few_samples) | ||
| data -= mu[:, None] * (mu[None, :] / n_samples) | ||
| data /= n_samples - 1.0 | ||
| logger.info("Number of samples used : %d", n_samples) | ||
| logger.info(f"Number of samples used : {n_samples}") | ||
| logger.info("[done]") | ||
| ch_names = [raw.info["ch_names"][k] for k in picks] | ||
| bads = [b for b in raw.info["bads"] if b in ch_names] | ||
|
|
@@ -1196,7 +1196,7 @@ def _unpack_epochs(epochs): | |
| # add extra info | ||
| cov.update(method=this_method, **data) | ||
| covs.append(cov) | ||
| logger.info("Number of samples used : %d", n_samples_tot) | ||
| logger.info(f"Number of samples used : {n_samples_tot}") | ||
| covs.sort(key=lambda c: c["loglik"], reverse=True) | ||
|
|
||
| if len(covs) > 1: | ||
|
|
@@ -1849,7 +1849,7 @@ def _smart_eigh( | |
| if isinstance(C, Covariance): | ||
| C = C["data"] | ||
| if ncomp > 0: | ||
| logger.info(" Created an SSP operator (subspace dimension = %d)", ncomp) | ||
| logger.info(f" Created an SSP operator (subspace dimension = {ncomp})") | ||
| C = np.dot(proj, np.dot(C, proj.T)) | ||
|
|
||
| noise_cov = Covariance(C, ch_names, [], projs, 0) | ||
|
|
@@ -2297,10 +2297,8 @@ def compute_whitener( | |
| C = np.sqrt(eig) * noise_cov["eigvec"].conj().T # C ** 0.5 | ||
| n_nzero = nzero.sum() | ||
| logger.info( | ||
| " Created the whitener using a noise covariance matrix " | ||
| "with rank %d (%d small eigenvalues omitted)", | ||
| n_nzero, | ||
| noise_cov["dim"] - n_nzero, | ||
| f" Created the whitener using a noise covariance matrix " | ||
| f"with rank {n_nzero} ({noise_cov["dim"] - n_nzero} small eigenvalues omitted)" | ||
| ) | ||
|
|
||
| # Do the requested projection | ||
|
|
@@ -2428,10 +2426,7 @@ def _read_cov(fid, node, cov_kind, limited=False, verbose=None): | |
| data = tag.data | ||
| diag = True | ||
| logger.info( | ||
| " %d x %d diagonal covariance (kind = %d) found.", | ||
| dim, | ||
| dim, | ||
| cov_kind, | ||
| f" {dim} x {dim} diagonal covariance (kind = {cov_kind}) found." | ||
| ) | ||
|
|
||
| else: | ||
|
|
@@ -2444,20 +2439,14 @@ def _read_cov(fid, node, cov_kind, limited=False, verbose=None): | |
| data.flat[:: dim + 1] /= 2.0 | ||
| diag = False | ||
| logger.info( | ||
| " %d x %d full covariance (kind = %d) found.", | ||
| dim, | ||
| dim, | ||
| cov_kind, | ||
| f" {dim} x {dim} full covariance (kind = {cov_kind}) found." | ||
| ) | ||
| else: | ||
| diag = False | ||
| data = tag.data | ||
| logger.info( | ||
| " %d x %d sparse covariance (kind = %d) found.", | ||
| dim, | ||
| dim, | ||
| cov_kind, | ||
| ) | ||
| f" {dim} x {dim} sparse covariance (kind = {cov_kind}) found." | ||
| ) | ||
|
|
||
| # Read the possibly precomputed decomposition | ||
| tag1 = find_tag(fid, this, FIFF.FIFF_MNE_COV_EIGENVALUES) | ||
|
|
@@ -2499,7 +2488,7 @@ def _read_cov(fid, node, cov_kind, limited=False, verbose=None): | |
|
|
||
| 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})") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one I think was okay in |
||
|
|
||
| return None | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
warnfunction is really a wrapper aroundwarnings.warnwhich doesn't use*argsor delayed%formattingThere was a problem hiding this comment.
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()?
There was a problem hiding this comment.
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