-
Notifications
You must be signed in to change notification settings - Fork 1.4k
FIX: Warn on rank estimate with too few samples #13350
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
Signed-off-by: Emmanuel Ferdman <[email protected]>
Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴 |
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.
thx !
Wow, this causes more than 30 tests to fail. Will need some investigation as to which ones are legitimate failures and how to correct them |
We should probably turn it into a warning instead |
Signed-off-by: Emmanuel Ferdman <[email protected]>
for more information, see https://pre-commit.ci
@@ -184,7 +184,7 @@ def _estimate_rank_meeg_signals( | |||
""" | |||
picks_list = _picks_by_type(info) | |||
if data.shape[1] < data.shape[0]: | |||
ValueError( | |||
warn( |
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.
From talking to @drammock today, it might actually be safest to have a on_few_samples="raise"
option in public-facing functions/APIs that eventually gets passed to this function. Then you can use _on_missing(...)
helper function to throw an error or emit a warning. Would you be up for trying this?
Then in the tests below you should be able to pass on_few_samples="ignore"
rather than adding a pytest warning ignore decorator
PR Summary
This small PR warns on rank estimate with too few samples.