Commit ff9179e
FIX, DOC: Pipeline methods shouldn't accept just any instance of raw (lina-usc#213)
* FIX, DOC: Pipeline methods shouldn't accept just any instance of raw
Following up from lina-usc#212. I realized that if one did do `my_pipeline.find_outlier_chs(my_raw), then under the hood
this method would actually create an epochs instance from my_pipeline.raw ...
this would lead to unexpected results if my_raw and my_pipeline.raw are not the same object of memory (i.e. they are different raw objects).
Since in our codebase we never do pipeline.find_outlier_chs(raw), I dont think we should support this.
Instead, we should either always expect an instanc of mne.Epochs
OR
We should change the method signature to be def find_outlier_chs(epochs=None) , where if it is None, the method creates epochs from pipeline.raw under the hood.
* Apply suggestions from Christian O'Reilly code review
- Change API form `inst` to `epochs | None`
- if `None`, then make epochs from self.raw
- No need check and raise type error now.
Co-authored-by: Christian O'Reilly <[email protected]>
* FIX: cruft
* DOC: improve docstring a little
* DOC, FIX: add example to docstring and explicitly call pick
* TST: OK codecov here is your test :)
* STY: 2 lines bt functions
* API: make epochs=None the default find_outlier_chs(epochs=None)
---------
Co-authored-by: Christian O'Reilly <[email protected]>1 parent 2b53d93 commit ff9179e
2 files changed
+53
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
770 | 770 | | |
771 | 771 | | |
772 | 772 | | |
773 | | - | |
774 | | - | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
775 | 811 | | |
776 | 812 | | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
785 | 816 | | |
786 | 817 | | |
787 | 818 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
73 | 85 | | |
74 | 86 | | |
75 | 87 | | |
| |||
0 commit comments