-
Notifications
You must be signed in to change notification settings - Fork 1
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
Remove Savitzky-Golay filter in suppression detection #102
base: master
Are you sure you want to change the base?
Conversation
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.
Verify tests, check that everything makes sense, and add new tests.
Start by checking the existing ones (currently failing). Make sure that the detection does not break. Then add similar tests for signals containing artifacts, i.e. what happens when you have an artifact in the middle of a suppression? Write a test which ensures the correct behaviour. |
Replace strict inequality by large inequality.
Done ! |
with np.errstate(invalid='ignore'): | ||
ies_mask = envelope < threshold | ||
ies_mask = envelope <= threshold |
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.
Why do we need this change?
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.
Because otherwise something occurs when, during the suppression, there is a single sample with value threshold, placed at a time t < min_duration after the beginning of the suppressions. In this case, the interval before the problematic sample is not considered as a suppression. This is what made the tests fail on the first commit. An AssertionError was raised when running test_detect_suppressions(3). Because the sample 532 was in the situation I mentionned before.
# The suppressions must not overlap with the artifact | ||
sec = pd.Timedelta('1s') | ||
assert detections.loc[0].end < 3.2 * sec | ||
assert detections.loc[1].end > 4.8 * sec |
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.
probably start
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.
Oh yes, sorry about that, I'll change it
Cannot reproduce, see #79 |
Allows the detect_suppressions function to work on recordings on which artifacts have been detected.
I'm not sure what tests you want me to add to the pull request, please let me know if I need to add stuff.