-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Open
1himan
wants to merge
29
commits into
mne-tools:main
Choose a base branch
from
1himan:interpolate_bads_bugfix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+44
−0
Open
Changes from 19 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
54dd4a1
Raising meaningful warnings/errors for interpolate_bads, when supplie…
1himan be254c4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 7f5d63b
Improved logic and error message
1himan 0fa2ba9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 272c38a
Removed my custome testing file
1himan 04d2f7e
minor changes
1himan db1b993
Fixing CI tests
1himan 8ea167e
Merge branch 'main' into interpolate_bads_bugfix
1himan 8c0a5a9
Merge branch 'main' into interpolate_bads_bugfix
1himan feb4415
Merge branch 'main' into interpolate_bads_bugfix
1himan 63f8dd5
Validation warning while processing docstring for .interpolate_bads()…
1himan c566b90
Merge branch 'interpolate_bads_bugfix' of https://github.com/1himan/m…
1himan c1bcbc5
Indentation fix
1himan fec6daf
CLI check fix
1himan fdff96d
Merge branch 'mne-tools:main' into interpolate_bads_bugfix
1himan d84c11f
this fixes the cli tests
1himan 54c82e5
Merge branch 'main' into interpolate_bads_bugfix
1himan 78ad836
Made suggested changes
1himan 9358051
Improved tests
1himan 2d19ecb
Fixed linting errors
1himan 68f7039
Merge branch 'main' into interpolate_bads_bugfix
1himan 4915ff0
Rmoved redundancy
1himan e4b7bb9
Merge branch 'main' into interpolate_bads_bugfix
1himan 68dbb28
Added dev entries, and fixed test logic
1himan fecd9c9
Merge branch 'main' into interpolate_bads_bugfix
1himan a3f70e3
Fixing ci tests
1himan fc9621f
Merge branch 'main' into interpolate_bads_bugfix
1himan 4238184
Merge branch 'main' into interpolate_bads_bugfix
1himan 3828f82
Polish
1himan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two thoughts about this:
method="nan"it's actually quite plausible to want to apply this to channels with invalid locations. So I wonder if we want to issue this warning at all ifmethod="nan". My hunch is that we probably still do want to warn, but would like other opinions (@larsoner ?)Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original issue which this PR is meant to fix, was more of a UX improvement request, that we should at least raise a warning when interpolating a channel with bad sensor positions instead of silently interpolating the channel to
np.nan."ignore"- interpolate anyways"warn"- interpolate anyways as well, but leaves a warning message in terminal"raise"- no interpolation, stops the code execution and gives a runtime warningTo make it less confusing, I think, the default value should be
on_bad_position="raise"instead of"warn".Because, for most of the users who happened to have the data with invalid sensor positions, the workflow would look like:
.interpolate_bads()on_bad_position="raise""ignore"it, or some users(who know what they're doing) might wanna use"warn"just as a reminder/note. Apart from that I don't see"warn"to be of any use, or any case where the user want to deliberately set it?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also in the end it just depends on how we want things to be,
"raise"could be a default for "better UX" since its good to tell users, "hey, there's something wrong with your code, so we're stopping the code execution immediately, see below for possible fixes", and then show a meaningful error message in the terminal and tell them to either use"warn"or"ignore", to continue.But if we don't wanna:
for "better UX", we might wanna use
"warn"as default.Its just a choice of what we consider "better UX" to be?