-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Raising meaningful warnings/errors for interpolate_bads, when supplie… #13518
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
base: main
Are you sure you want to change the base?
Conversation
…d loc field with missing or invalid data
for more information, see https://pre-commit.ci
|
Should we update the user about what's going on, on a deeper level or is it going to be too verbose. Because if we look, that why the bug exists, its primarily because of how create_info creates the info dict structure - its all NaN for the loc field. Of course we're not expecting the user to provide the exact positions of the sensor but we should also give the user a heads up about this. Also in the add_channels, something like: And something similar for the interpolate_bads. If that's the case then we should create a separate utility method for this, something like: def _is_invalid_loc(loc):
return np.allclose(loc, 0.0, atol=1e-16) or np.isnan(loc).any()And use that, wherever its required to warn the user about this. |
|
@1himan I haven't followed this ticket super closely but if I understand correctly it seems like you are talking about 2 or 3 different ideas here: 1: "Should we update the user about what's going on on a deeper level [during the
|
|
So what should I do, @scott-huberty? Just add a check and a warning message within it - in the interpolate_bads method. the current commit already includes it - just some CI checks left. That's it? |
Raising meaningful warnings/errors for interpolate_bads, when supplied loc field with missing or invalid data.
What does this implement/fix?
Fix - raise error in interpolate_bads if no sensor positions are provided
Additional information
TODO:
Add checks in add_channels() as well.
Refactor code according to mne's philosophy.