Add _on_missing functionality to UpdateChannelsMixin#11077
Merged
drammock merged 12 commits intomne-tools:mainfrom Aug 24, 2022
Merged
Add _on_missing functionality to UpdateChannelsMixin#11077drammock merged 12 commits intomne-tools:mainfrom
drammock merged 12 commits intomne-tools:mainfrom
Conversation
Member
|
@AJQuinn merge conflict on the changelog file. |
Member
|
to debug this failure locally: run |
…ajquinn/mne-python into drop_channels_on_missing_update
agramfort
reviewed
Aug 23, 2022
doc/changes/latest.inc
Outdated
| - Add ``starting_affine`` keyword argument to :func:`mne.transforms.compute_volume_registration` to initialize an alignment with an affine (:gh:`11020` by `Alex Rockhill`_) | ||
| - The ``trans`` parameter in :func:`mne.make_field_map` now accepts a :class:`~pathlib.Path` object, and uses standardised loading logic (:gh:`10784` by :newcontrib:`Andrew Quinn`) | ||
| - Allow :func:`mne.beamformer.make_dics` to take ``pick_ori='vector'`` to compute vector source estimates (:gh:`19080` by `Alex Rockhill`_) | ||
| - Add ``on_missing`` functionality to :class:`mne.channels.UpdateChannelsMixin` to tune drop_channels behaviour when specified channel names are not found(:gh:`11043` by `Andrew Quinn`_) |
Member
There was a problem hiding this comment.
Suggested change
| - Add ``on_missing`` functionality to :class:`mne.channels.UpdateChannelsMixin` to tune drop_channels behaviour when specified channel names are not found(:gh:`11043` by `Andrew Quinn`_) | |
| - Add ``on_missing`` functionality to :class:`mne.channels.UpdateChannelsMixin` to tune drop_channels behaviour when specified channel names are not found (:gh:`11077` by `Andrew Quinn`_) |
Contributor
Author
There was a problem hiding this comment.
Thanks @agramfort - now fixed in 9ef982d
drammock
reviewed
Aug 23, 2022
Co-authored-by: Daniel McCloy <[email protected]>
agramfort
reviewed
Aug 24, 2022
drammock
reviewed
Aug 24, 2022
mne/channels/tests/test_channels.py
Outdated
Comment on lines
+454
to
+456
| pytest.raises(ValueError, raw.drop_channels, m_chs) | ||
| # ...but this can be turned to a warning | ||
| pytest.warns(RuntimeWarning, raw.drop_channels, m_chs, on_missing='warn') |
Member
There was a problem hiding this comment.
sorry I didn't catch this before, but ideally these should use the newer context-manager style of raises or warns. git grep "with pytest.raises" will show you some examples of the syntax; the advantage is (1) easier to read what's being tested and (2) checks that the actual error/warning message matches rather than just the error/warning type.
Co-authored-by: Alexandre Gramfort <[email protected]>
agramfort
approved these changes
Aug 24, 2022
auto-merge was automatically disabled
August 24, 2022 09:04
Head branch was pushed to by a user without write access
drammock
reviewed
Aug 24, 2022
drammock
approved these changes
Aug 24, 2022
larsoner
added a commit
to larsoner/mne-python
that referenced
this pull request
Aug 29, 2022
* upstream/main: (366 commits) BUG: Spectrum deprecation cleanup [circle deploy] (mne-tools#11115) Add API entry list and map (mne-tools#10999) Add legacy decorator (mne-tools#11097) [ENH, MRG] Add time-frequency epoch source estimation (mne-tools#11095) Revert "Add error message when conversion of EEG locs to [circle deploy] (mne-tools#11104) MRG: Fixes for mne-tools#11090 (mne-tools#11108) add test for edf units param (mne-tools#11105) BUG: Improve logic for bti (mne-tools#11102) add spectrum class (mne-tools#10184) ENH : add units parameter to read_raw_edf in case units is missing from the file (mne-tools#11099) ENH: Add temperature and galvanic (mne-tools#11090) Add error message when conversion of EEG locs to head space fails (mne-tools#11080) DOC: removed unnecessary line in PSF example (mne-tools#11085) FIX: Update helmet during ICP (mne-tools#11084) Fix various typos (mne-tools#11086) DOC: Rel BUG: don't assume that channel info contains particular keys (mne-tools#11074) [BUG] Fix plot_topomap with sphere="eeglab" (mne-tools#11081) Add `vmin` and `vmax` specification to `mne.Evoked.animate_topomap` (mne-tools#11073) Add _on_missing functionality to UpdateChannelsMixin (mne-tools#11077) ...
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
Example: Fixes #11043.
What does this implement/fix?
This PR adds _on_missing functionality to UpdateChannelsMixin to customise behaviour when specified channel names are not found in object.