Repository navigation
Conversation
Use the normalized Process result origin and shift only the named time levels. This handles missing and sample-count starts and preserves file metadata returned by nested process_signal callbacks.
Contributor
Reviewer's GuideRepairs signal cropping so nested and direct segmentation callbacks use the Process-normalized origin, correctly offset only start/end timestamp levels, and preserve file metadata and result ordering across supported start formats. Sequence diagram for normalized signal crop offsetssequenceDiagram
participant Caller
participant Segment
participant Process
participant Callback
Caller->>Segment: process_signal(signal, sampling_rate, start, end)
Segment->>Process: process_signal(signal, sampling_rate, start, end)
Process->>Callback: process_func(signal)
Callback-->>Process: index with start/end levels
Process-->>Segment: y with normalized start origin
Segment->>Segment: shift start and end levels by y.index start
Segment-->>Caller: indexed result preserving file metadata and row order
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Segment.process_signal()converts the requested start again after the underlyingProcesshas already normalized it. This second conversion loses the sampling rate for sample-count strings and propagatesNaTinstead of the normalized zero origin. It also assumes the callback result has only two levels: a nestedSegment.process_signalcallback receives the file argument and returns a file/start/end index, so offsetting level 0 raises on the filename strings.Use the normalized origin from the
Processresult and shift only the named start/end levels. Preserve row order and any file metadata. The regression covers direct/nested callbacks, tagged/untagged signals, missing starts, sample strings and nanosecond precision, with deliberately non-monotonic end times.Related to #117; its original file-index example already works on current main. This change repairs the remaining in-memory crop path and is independent of #209's file-input correction.
Validation:
pytest: 696 passed, 54 xfailed, 100% coverage.