-
Notifications
You must be signed in to change notification settings - Fork 234
Fix tmax in SleepPhysionet
#612
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: master
Are you sure you want to change the base?
Conversation
- `annots[idx]["onset"]` is inclusive on time *starts*, so to include all of `idx`, add duration and decrement a sample - `int` is redundant
|
that gives you now samples of 3000 values for 30s at 100Hz and before it was 3001? |
|
I don't follow, can you clarify? |
|
I don't understand |
|
if you are breaking a test it suggests there is a reason things are done
this way? sorry I don't have the full background here.
Why do you think it's a bug?
… Message ID: ***@***.***>
|
Put differently, the intent is to include the entire segment whereas it should be |
|
Also, the existing code fails the new assertion I added (it's off by one sample, as expected), mine doesn't. The assertion's motivated by https://sci-hub.st/10.1109/TNSRE.2018.2813138 ,
|
| a_tmax = annots[sleep_event_inds[-1]] | ||
| tmin = a_tmin["onset"] - crop_wake_mins * 60 | ||
| tmax = a_tmax["onset"] + a_tmax["duration"] - dT + crop_wake_mins * 60 | ||
| raw.crop(tmin=max(tmin, raw.times[0]), tmax=min(tmax, raw.times[-1])) |
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.
maybe you just want to keep old version but set include_tmax=False in raw.crop?
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.
That only resolves - dT.
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.
can you already fix accordingly? also can you see why CIs fail?
annots[idx]["onset"]is inclusive on time starts, so to include all ofidx, add duration and decrement a sampleintis redundant