Repository navigation
Conversation
Use the start time from the underlying Process result when offsetting returned segments. This accepts documented numeric and string starts without redoing their conversion, and keeps the existing precise Timedelta origin.
Contributor
Reviewer's GuideNormalize segment origins through the underlying Process result before combining them with relative segment timestamps, fixing numeric and string starts while preserving precision; add broad regression coverage for supported start types. Sequence diagram for normalized segmented audio originssequenceDiagram
participant Caller
participant Segment
participant Process
participant Pandas
participant AudioFormat
Caller->>Segment: process_file(file, start, end)
Segment->>Process: process_file(file, start, end, root, process_func_args)
Process-->>Segment: y with normalized start index
Segment->>Pandas: y.values[0]
Segment->>Pandas: y.index.get_level_values(start)[0]
Segment->>AudioFormat: segmented_index(files, starts=index starts + normalized start)
AudioFormat-->>Caller: segmented audio results
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_file()accepts numeric and string start positions through its underlyingProcess, then adds the original argument to the returned timedelta values. Calls such asstart=0.25orstart="250ms"therefore raise after the audio has been processed.Use the normalized start time from the
Processresult when offsetting the segments. This also handles sample-count strings without repeating their conversion and preserves preciseTimedeltaorigins.Add regression cases for integer/float seconds, unit strings, sample-count strings, missing starts and nanosecond precision.
Validation:
pytest: 678 passed, 54 xfailed, 100% coverage.