Repository navigation
Conversation
Normalize slice starts against the signal length and apply the stride to the sampling period in both bare and tuple indexing. Negative or clipped starts then refer to the samples actually selected, and a bare stride has the same timing as its tuple equivalent.
Contributor
|
I have requested @apdavison to help review this. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
signal[::2]currently keeps the original sampling period, and negative slice starts are treated as literal time offsets. For example, a ten-sample signal starting at 2 s at 4 Hz reportssignal[-3:].t_startas 1.25 s instead of 3.75 s.Normalize the start against the signal length and apply the stride to the sampling period for both bare and tuple slices. Add regressions for negative/clipped starts, forward/reverse strides and nested slices. The separate author-list commit follows the first-contribution instructions.
Validation: 633 core tests and 24 subtests pass; Black passes on the changed Python files. On recorded EEGMMIDB S001/R04 data, all 30 slicing configurations match absolute sample-index timestamps after the fix, correcting 18 configurations and 227 event-window selections. All sample values and 12 complete control results stay unchanged. This changes
__getitem__; thetime_slicechange in #1905 remains separate.