-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ENH: Add on_drop_all parameter to Epochs.drop #13556
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
for more information, see https://pre-commit.ci
|
you're going to need to add tests. |
…ython into warn-epochs-drop
for more information, see https://pre-commit.ci
|
I have added the test case in mne/tests/test_epochs.py as requested. It covers warn, raise, ignore, and invalid input scenarios. |
mne/tests/test_epochs.py
Outdated
| def test_drop_all_epochs(): | ||
| """Test on_drop_all parameter in Epochs.drop.""" | ||
| # Create tiny dummy data (3 epochs) | ||
| data = np.random.randn(3, 1, 10) |
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.
use a random state to avoid touching the global seed.
| data = np.random.randn(3, 1, 10) | |
| data = np.random.RandomState(0).randn(3, 1, 10) |
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 you can use only 1 epoch and not 3. It's a good habit to take to think about keep the test time as low as possible
|
I switched to RandomState(0) and cut it down to 1 epoch. Thanks for the tip on keeping the tests fast—that's a good habit to build. Well I had a doubt regarding the number of epochs, I know most standard experiments usually have a few hundred epochs, but do MNE users often work with massive datasets (like thousands of epochs for sleep scoring)? I'm just trying to get a better idea about how aggressive I should be with optimization in future PRs |
Implements the on_drop_all parameter to warn or raise an error when all epochs are dropped, as discussed in #13473.