[MRG] Require good and bad channels when creating a SpectrumArray object#12877
Merged
mscheltienne merged 7 commits intomne-tools:mainfrom Oct 1, 2024
Merged
[MRG] Require good and bad channels when creating a SpectrumArray object#12877mscheltienne merged 7 commits intomne-tools:mainfrom
mscheltienne merged 7 commits intomne-tools:mainfrom
Conversation
Member
|
This one looks real: |
Co-authored-by: Daniel McCloy <dan@mccloy.info>
drammock
reviewed
Oct 1, 2024
Co-authored-by: Daniel McCloy <dan@mccloy.info>
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) ...
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
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 59inspectrum.plot, i.e. the plotting functions expects the good and bad channels. And indeed,spectrum1orspectrum2include 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 indata(60) must match the number of good data channels ininfo(59).There is a clear inconsistency in what
SpectrumArrayexpects andBaseSpectrum.plotexpects. I think the cleaner fix is to haveSpectrumArrayrequire thegoodandbadchannels; matching the behavior obtained bySpectrumwhen runninginst.compute_psd(...).