Skip to content

FIX: set_montage behavior for DigMontage + deprecate the rest.#6765

Merged
larsoner merged 57 commits intomne-tools:masterfrom
massich:set_digmontage_when_chnames_mismatch
Sep 19, 2019
Merged

FIX: set_montage behavior for DigMontage + deprecate the rest.#6765
larsoner merged 57 commits intomne-tools:masterfrom
massich:set_digmontage_when_chnames_mismatch

Conversation

@massich
Copy link
Copy Markdown
Contributor

@massich massich commented Sep 13, 2019

This PR reviews the behavior of setting a DigMontage:

1 - what happens if info['ch_names'] and montage.ch_names are different versions of the same (i.e: 'EEG 001' and 'EEG001')?
crashes. This needs to be taken care of by the user.

2 - what happens when montage is a sub/super set of info?
* supper set case: warns, sets up info['ch_pos'] and info['dig'] for the ch_names already in info
* subset case: crashes.

3 - requires montage to be in 'head' (or being able to be transformed in 'head'). Crashes otherwise.

cc: @agramfort, @larsoner

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 13, 2019

Codecov Report

Merging #6765 into master will increase coverage by 1.3%.
The diff coverage is 97.95%.

@@            Coverage Diff            @@
##           master    #6765     +/-   ##
=========================================
+ Coverage   88.23%   89.53%   +1.3%     
=========================================
  Files         421      422      +1     
  Lines       76301    76408    +107     
  Branches    12478    12490     +12     
=========================================
+ Hits        67325    68415   +1090     
+ Misses       6174     5183    -991     
- Partials     2802     2810      +8

@massich massich force-pushed the set_digmontage_when_chnames_mismatch branch 2 times, most recently from b05bd2c to 1e11b77 Compare September 13, 2019 13:58
@larsoner larsoner added this to the 0.19 milestone Sep 15, 2019
@massich massich force-pushed the set_digmontage_when_chnames_mismatch branch 3 times, most recently from f2f0231 to 0469e8b Compare September 16, 2019 12:11
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Sep 16, 2019

This pull request introduces 1 alert when merging a3c7d69 into 2545faf - view on LGTM.com

new alerts:

  • 1 for Wrong number of arguments in a call

@massich massich force-pushed the set_digmontage_when_chnames_mismatch branch 2 times, most recently from 7cc31bc to 2fc5963 Compare September 17, 2019 15:18
@massich massich force-pushed the set_digmontage_when_chnames_mismatch branch 2 times, most recently from 859d6f8 to 021198f Compare September 18, 2019 16:26
@massich massich changed the title [RFC] Setup DigMontage to mismatching raw.ch_names FIX: set_montage behavior for DigMontage + deprecate the rest. Sep 19, 2019
@massich massich force-pushed the set_digmontage_when_chnames_mismatch branch from 3326cff to bbbf5f6 Compare September 19, 2019 14:13
@massich massich force-pushed the set_digmontage_when_chnames_mismatch branch from bbbf5f6 to e7f05a2 Compare September 19, 2019 15:35
@massich
Copy link
Copy Markdown
Contributor Author

massich commented Sep 19, 2019

@larsoner This should be good to go, can you do a pass? Thx

This PR only deprecates parts of set_montage and fixes the bihavior of set_montage when using DigMontage.

@massich
Copy link
Copy Markdown
Contributor Author

massich commented Sep 19, 2019

This PR blocks #6764

@massich
Copy link
Copy Markdown
Contributor Author

massich commented Sep 19, 2019

Does anyone know how can I pinpoint set_montage of RawEEGLAB in the whats new?
cc: @drammock

@larsoner
Copy link
Copy Markdown
Member

@larsoner
Copy link
Copy Markdown
Member

You are probably running a recent enough Python that dict iteration order is guaranteed. On 3.5 it's not

@larsoner larsoner mentioned this pull request Sep 19, 2019
8 tasks
@larsoner larsoner force-pushed the set_digmontage_when_chnames_mismatch branch from 23aa211 to 046e289 Compare September 19, 2019 19:05
Copy link
Copy Markdown
Member

@agramfort agramfort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

besides this LGTM +1 for MRG if CIs are happy

@larsoner larsoner merged commit f1f8e54 into mne-tools:master Sep 19, 2019
@massich massich deleted the set_digmontage_when_chnames_mismatch branch September 24, 2019 08:02
alexrockhill pushed a commit to alexrockhill/mne-python that referenced this pull request Oct 1, 2019
…ools#6765)

* TST: reveal issues

* TST: Add a test describing current status

* Add example modifying montage names

* TST: Add test showing how to set mismatching montages

* TST: set up the sub/super set behavior

* WIP: set_montage for DigMontage (with and without ref)

* ENH: use view

* TST, BUG-FIX: Adapt tests to the new set_montage. (new is good)

* WIP, TST: start working with getting a propper info_'dig'_

* wip (I'm doing something wrong)

* wip

* done. todo: fix deprecationwarn in generator

* fix: StopIteration Deprecation warning

* wip

* FIX: HPI was FIFF_EEG_CH, but somewhere I've seen EEEG_REF being same

* clean up

* WIP: remove the generator

* check set_dig

* FIX: test_fif_dig_montage

* WIP: bypass set_montage in egi test

* WIP: bypass set_montage in bvct

* wip: fix bvct (second test)

* WIP: better error handling. it will simplify the TST + backcompat

* wip

* WIP: I can do pick_types with including the bad channels

* Fix

* FIX: just selecting all eeg_like should make the trick

* WIP: Add transformation to head in set_montage when necessary

* TST: revert the funky _egi_set_montage and do a pass on the egi test

* TST: revert the funky _set_montage for bvct

* WIP: fix some

* FIX: fieldtrip, but it might be a BUG

* wip

* FIX: avoid using _coord_frame

* remove example

* WIP: Add deprecation

* FIX some deprecations

* BUG: Brainvision

* wip

* wip

* WIP: use _fix_montage in eeglab

* wip

* wip

* wip

* wip: eeglab

* wip: fixing more

* revert

* montage is not needed to test ica

* ups I deleted the wrong file

* FIX: deprecations

* thats funny

* update whats_new

* clean-up

* FIX: A few more

* FIX: Old NumPy

* FIX: More

* FIX: Old NumPy is annoying
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants