Skip to content
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

Allow notch filtering of epochs #12403

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

ikarabinas
Copy link

Reference issue

Resolves #12398

What does this implement/fix?

Moved notch_filter from mne/io/base.py to class FilterMixin in mne/filter.py to allow filtering of Epoch objects, not only Raw. Fixed broken link to the contributing guidelines.

Moved notch_filter to class FilterMixin in filter.py and updated contributing guide link
Copy link

welcome bot commented Jan 31, 2024

Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴

Copy link
Member

@larsoner larsoner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good start! Can you look at why the CIs fail? They should tell you some stuf about what is wrong. If it doesn't make sense I can give more pointers (but I'm hoping they're maybe clear enough!).

Any new change should come with updated tests that ideally fail on main but pass on the new PR. In your case that would probably involve writing some code that calls epochs.notch_filter -- that wouldn't exist on main (and hence fail) but should pass on this PR. I'd suggest around here in test_epochs.py somewhere since it's where we test other Epochs filtering methods:

assert_allclose(epochs.get_data(), data_filt, atol=1e-17)

It would be awesome if you computed the PSD before and after and checked for example that you could remove 60 Hz noise -- but even starting out with having a call to epochs.notch_filter(...) would be a good start!

@@ -5,5 +5,5 @@ MNE-Python is maintained by a community of scientists and research labs. The pro

Users and contributors to MNE-Python are expected to follow our [code of conduct](https://github.com/mne-tools/.github/blob/main/CODE_OF_CONDUCT.md).

The [contributing guide](https://mne.tools/dev/development/contributing.html) has details on the preferred contribution workflow
The [contributing guide](https://mne.tools/stable/development/contributing.html) has details on the preferred contribution workflow
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one should actually still point to the dev page because it stays most up-to-date (updated roughly daily), and so is the best guide for current practice

Suggested change
The [contributing guide](https://mne.tools/stable/development/contributing.html) has details on the preferred contribution workflow
The [contributing guide](https://mne.tools/dev/development/contributing.html) has details on the preferred contribution workflow

@larsoner larsoner added this to the 1.7 milestone Feb 6, 2024
@larsoner larsoner modified the milestones: 1.7, 1.8 Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MNE Epochs notch_filter feature request (re: #12092)
2 participants