-
Notifications
You must be signed in to change notification settings - Fork 27
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
Boundary condition on trimming #204
Conversation
I would second this option. |
@justinsalamon what do you think? |
Sounds like a reasonable solution to me (explicitly handling), given that for events with any non-zero duration this becomes a non-issue. |
Ok, done. Docs updated as well. |
Shall we merge this then? |
Not sure if it counts for anything.... but I took a quick peek at the changed files and it all LGTM. Thanks for addressing this. |
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.
All looks fine to me.
Looks like I dropped the ball on this, but at ~3 months it looks fine to me. |
This PR fixes #203 by including observations which have end time coincident with the trimming start time.
I'm still not 100% sure this is completely correct. It works for @tomxi's example case, where there was a time=0, duration=0 observation being trimmed to start at 0. This should clearly be included.
However, if we have an observation
[2, 2+1)
with a trim of[3, 10)
, the modified logic will allow it to pass through, when it probably shouldn't, since[2, 3) ∩ [3, 10) = {}
. The ambiguity here comes from our special-case handling of duration-0 observations, which we treat as closed intervals to allow a (Nyquist-style) sampling interpretation.Perhaps we should explicitly handle this case, by only allowing the boundary condition
end_time >= trim_start
if the observation duration is 0?