-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ENH: Add multiple label support to source_band_induced_power, source_induced_power #12026
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
Conversation
larsoner
left a comment
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.
Great! Next (before adding anything else) I would add a test that return_plv actually makes the pow, itc tuple get returned. Don't actually need to check the values but you could for example make sure that their data shapes are the same
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
|
Let's check in about how we want to handle output for single labels and any other main feedback points about restricting K and then averaging power over labels. After we've got that shored up, then I will need to do work on the tests. |
|
The most recent commit proposes performing kernel restriction to labels within the If we want to continue on with |
The current public API of https://mne.tools/stable/generated/mne.minimum_norm.compute_source_psd_epochs.html says it only supports a single label. So the easy way out is to still only allow that behavior in that function, but add in a code comment somewhere ... or if you want to go into bonus territory, yes you make |
|
Thanks, @larsoner! About single label behavior: do you think the |
Yes exactly. We keep backward compat that way. And to me it's okay (even though it's a bit awkward) that |
|
@larsoner Looks like pre-commit hooks fixed a whitespace issue that's now causing CircleCi to fail (unregistered user issue). Can I fix this or does it need to be you? |
|
You can fix it and push a commit |
|
@larsoner There's nothing to fix in terms of the code, so am I pushing an empty commit to get CircleCI to restart? |
|
Yes you can but these style CIs are red, too https://github.com/mne-tools/mne-python/actions/runs/6550989358/job/17791250636?pr=12026 |
|
@larsoner I'm puzzled about the 4 failed CircleCi tests. It looks to me like they're failing on code that a) I didn't touch, b) doesn't call code that I touched, and c) passes pytest on my machine locally. Do you have thoughts on what's happening? |
|
|
@drammock Thanks, Dan. About the multi-label one, my raw instantiation call is the same as the one above it in |
yes indeed. Look at the step in which the failure occurs: https://github.com/mne-tools/mne-python/actions/runs/6551626097/job/17793283214?pr=12026 it's title is "Run tests with no testing data". adding the decorator would cause the test to get skipped on that CI job. |
larsoner
left a comment
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.
One major suggestion for refactoring/restructuring. If it's not clear let me know and I'm happy to chat about it, or if you want I can push a commit to try it
@larsoner Sounds good, exploiting the power of dicts more here is a good idea. I'll work on it and push, probably tomorrow! |
larsoner
left a comment
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 some tiny stuff and one remaining choice, then I think we can merge!
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
for more information, see https://pre-commit.ci
|
@larsoner Looks like nibabel errors are causing the CircleCi failures? |
larsoner
left a comment
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.
Pushed a tiny commit to make CIs happy (failures are unrelated but might as well get them fixed now!) and marking for merge-when-green, thanks @nordme !
* upstream/main: (35 commits) [DOC] Add documentation for setting montage order (mne-tools#12160) Fix inferring fiducials from EEGLAB (mne-tools#12165) Try to fix ICA Report (mne-tools#12167) BUG: Fix bug with Report.add_ica component number (mne-tools#12156) MAINT: Add rstcheck to CIs and pre-commit (mne-tools#12163) DOC: fix sphinx style typos (mne-tools#12161) MAINT: Fix linkcheck (mne-tools#12162) ENH: Add multiple label support to source_band_induced_power, source_induced_power (mne-tools#12026) Allow automated metadata generation to be bounded by "row events" instead of explicit time windows (mne-tools#12118) ENH: Collapse only in doc gen (mne-tools#12145) [pre-commit.ci] pre-commit autoupdate (mne-tools#12155) BUG: Fix bug with interior points not showing (mne-tools#12148) ENH: Warn about versions in sys_info (mne-tools#12146) Fix in conftest.py (mne-tools#12150) ENH: set color for bad channel with spatial_colors=True (mne-tools#12142) DOC: Better documentation of realign_raw (mne-tools#12135) Add mne-icalabel wildcard (mne-tools#12143) Remove LGTM.com configuration file (mne-tools#12139) DOC: Fix typo found by codespell (mne-tools#12140) DOC: Document governance updates (mne-tools#12133) ...
* upstream/main: (26 commits) FIX: Fix bug with coreg scalars (mne-tools#12164) Changed casting rule in np.clip to allow reading of raw GDF files (mne-tools#12168) [DOC] Add documentation for setting montage order (mne-tools#12160) Fix inferring fiducials from EEGLAB (mne-tools#12165) Try to fix ICA Report (mne-tools#12167) BUG: Fix bug with Report.add_ica component number (mne-tools#12156) MAINT: Add rstcheck to CIs and pre-commit (mne-tools#12163) DOC: fix sphinx style typos (mne-tools#12161) MAINT: Fix linkcheck (mne-tools#12162) ENH: Add multiple label support to source_band_induced_power, source_induced_power (mne-tools#12026) Allow automated metadata generation to be bounded by "row events" instead of explicit time windows (mne-tools#12118) ENH: Collapse only in doc gen (mne-tools#12145) [pre-commit.ci] pre-commit autoupdate (mne-tools#12155) BUG: Fix bug with interior points not showing (mne-tools#12148) ENH: Warn about versions in sys_info (mne-tools#12146) Fix in conftest.py (mne-tools#12150) ENH: set color for bad channel with spatial_colors=True (mne-tools#12142) DOC: Better documentation of realign_raw (mne-tools#12135) Add mne-icalabel wildcard (mne-tools#12143) Remove LGTM.com configuration file (mne-tools#12139) ...
…induced_power (mne-tools#12026) Co-authored-by: Eric Larson <larson.eric.d@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Daniel McCloy <dan@mccloy.info>
Fixes #11985.
What does this implement/fix?
source_induced_powerandsource_band_induced_powercurrently only allow one label to be passed for power and plv calculation. It should be able to do this over multiple labels.