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
MRG: Fix bug in nirs merge data #8306
Conversation
is the codecov issue legit? |
Yeah we aren't hitting the lines. I just checked locally that if we make #8307 we will hit the lines. |
Im trying to mock hit the lines now. Real data would be better, but cant get in lab. |
yes we can merge. I assume adding a test is difficult?
… |
I will try for a bit more to make a test. I will ping you when ready (or if I give up) |
Sorry but I cant make it hit the line with this 1e-10 parameter in #8307. I am very confident this is bug though. Happy to merge if you are |
let's go then
… |
Once this PR is merged, fetch latest upstream and update your local copy of master branch. Then create local branch that tracks |
Backported |
Thanks @agramfort @larsoner @drammock |
What does this implement/fix?
The
_merge_nirs_data
function is used in topo plotting and averages channels that are close together for a nicer display. After a channel is merged it is then removed from the data. If the same channel was merged twice, then it was removed twice, but the second time it was removing legitimate data. This would then mean the size of data and pos was incorrect and a nice error was thrown in the following topo function (which made it easy for met to find this bug). Here I just ensure each channel is only removed once.Additional information
I think this is a candidate for back port. Whats involved in that?
I found this error because I am considering proposing a different distance for merging channels, but that's an enhancement and I will put in another PR. But it means others aren't likely to hit this bug unless they are playing with internal functions.