-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
FIX: Fix grand_average
to support BaseSpectrum
objects
#13375
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
base: main
Are you sure you want to change the base?
Conversation
e805d81
to
f65c6ff
Compare
from ..time_frequency import BaseTFR, CrossSpectralDensity | ||
from ..time_frequency.spectrum import BaseSpectrum |
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.
Small note: can't import BaseSpectrum
directly from the time_frequency
module, and it's not included in the API reference, but BaseTFR
is.
def test_equalize_channels(raw_spectrum): | ||
"""Test equalization of channels for instances of `BaseSpectrum`.""" | ||
spect1 = raw_spectrum.copy() | ||
spect2 = spect1.copy().pick(["MEG 0122", "MEG 0111"]) | ||
spect1, spect2 = equalize_channels([spect1, spect2]) | ||
|
||
assert spect1.ch_names == ["MEG 0111", "MEG 0122"] | ||
assert spect2.ch_names == ["MEG 0111", "MEG 0122"] |
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.
This follows the existing tests for checking equalize_channels
with Raw
, Evoked
, CSD
, etc...
mne-python/mne/channels/tests/test_channels.py Lines 557 to 561 in f65c6ff
Going over this, I noticed this comment isn't technically true anymore, as
Is it worth adding a dedicated test as the comment alludes to? |
Reference issue (if any)
Fixes #13374
What does this implement/fix?
Allows
equalize_channels
to supportBaseSpectrum
objects.Additional information
Also adds a setter for
BaseSpectrum.nave
which is also required forgrand_average()
.