-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[MRG] Require good and bad channels when creating a SpectrumArray object #12877
Merged
Conversation
This file contains 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
mscheltienne
requested review from
larsoner,
drammock,
agramfort,
dengemann and
adam2392
as code owners
September 30, 2024 15:50
This one looks real:
|
mscheltienne
changed the title
Require good and bad channels when creating a SpectrumArray object
[MRG] Require good and bad channels when creating a SpectrumArray object
Oct 1, 2024
drammock
approved these changes
Oct 1, 2024
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.
just a few typos. LGTM!
Co-authored-by: Daniel McCloy <[email protected]>
drammock
reviewed
Oct 1, 2024
Co-authored-by: Daniel McCloy <[email protected]>
larsoner
added a commit
to larsoner/mne-python
that referenced
this pull request
Oct 28, 2024
* upstream/main: (824 commits) Add `psd_args` to `plot_ica_sources` and `ICA.plot_sources` (mne-tools#12912) Fix GDF NumPy >= 2 (mne-tools#12909) [pre-commit.ci] pre-commit autoupdate (mne-tools#12908) ENH: Improve report usability (mne-tools#12901) MAINT: Avoid problematic PySide6 (mne-tools#12902) Sync README dependencies with pyproject.toml (mne-tools#12890) remove trailing slash from pybv base URL [ci skip] (mne-tools#12892) Cast tuple of filenames to list to improve error handling (mne-tools#12891) Website (mne-tools#12885) [pre-commit.ci] pre-commit autoupdate (mne-tools#12888) BUG: Fix bugs with coreg (mne-tools#12884) Bump mamba-org/setup-micromamba from 1 to 2 in the actions group (mne-tools#12887) Update spacing for comments in pyproject.toml (mne-tools#12886) make HTML repr for Forward match others (mne-tools#12883) MAINT: Linkchecks [circle deploy] (mne-tools#12882) Update roadmap (mne-tools#12872) [MRG] Require good and bad channels when creating a SpectrumArray object (mne-tools#12877) [pre-commit.ci] pre-commit autoupdate (mne-tools#12879) MAINT: Update code credit (mne-tools#12880) BUG: Fix bug with Path casting (mne-tools#12878) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Failure reported today:
Raises
IndexError: index 59 is out of bounds for axis 0 with size 59
inspectrum.plot
, i.e. the plotting functions expects the good and bad channels. And indeed,spectrum1
orspectrum2
include thebads
, i.e. the underlying array as shape(60, ...)
.Now, if instead you include the bad channels:
It will also raise but this time in the creation of the
SpectrumArray
:ValueError: The number of channels in
data(60) must match the number of good data channels in
info(59).
There is a clear inconsistency in what
SpectrumArray
expects andBaseSpectrum.plot
expects. I think the cleaner fix is to haveSpectrumArray
require thegood
andbad
channels; matching the behavior obtained bySpectrum
when runninginst.compute_psd(...)
.