[BUG] Allow Epochs.compute_tfr() for the multitaper method and complex/phase outputs#12842
Merged
larsoner merged 6 commits intomne-tools:mainfrom Sep 16, 2024
Merged
[BUG] Allow Epochs.compute_tfr() for the multitaper method and complex/phase outputs#12842larsoner merged 6 commits intomne-tools:mainfrom
Epochs.compute_tfr() for the multitaper method and complex/phase outputs#12842larsoner merged 6 commits intomne-tools:mainfrom
Conversation
Member
Yes please do add it -- if the number of time points and channels is low it should be plenty fast, and it would be good to catch corner cases like this one! |
Contributor
Author
|
Just added a very short test that multitaper complex/phase TFR runs. |
larsoner
approved these changes
Sep 16, 2024
Member
|
Marking for merge-when-green, thanks in advance @tsbinns ! |
Contributor
Author
|
Seems some sklearn compliance checks are still failing. |
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.
Reference issue
Fixes #12831.
What does this implement/fix?
Fixes a bug where an internal check of the shape of TFR results was unexpectedly failing for results with both an epochs and tapers (multitaper method and complex/phase output) dimension.
Additional information
The check for whether an epochs dimension is present cannot rely on
self._dims, as"epoch"only gets added afterwards, so it is instead based on the data passed in (i.e., is it an epochs object?). We don't have to worry about whether an epochs dimension is still present (e.g., ifcompute_tfr()was called withaverage=True), sinceaverage=Trueis not allowed whenoutput="complex"/"phase".There is currently no test checking the combination of multitaper method and complex/phase output, and I haven't added one here to avoid overburdening the test suite. If this is required I can add one.