Conversation
Implements issue #256: 'Aggregating with key at the end'. - Series.windowWhileIntoFromEnd / windowWhileFromEnd: sliding windows where each window ENDS at the current key, extending backward while cond(startKey, endKey) holds. Backed by a new WindowWhileFromEnd aggregation type and Seq.windowRangesWhileFromEnd. - Series.chunkWhileIntoFromEnd / chunkWhileFromEnd: same chunking as chunkWhile but the key of each chunk is the LAST key of the chunk. - Aggregation.WindowWhileFromEnd static factory method for C# users. - Two new tests covering the expected behavior. The naming convention FromEnd is used (checked against existing API: no established convention exists; Direction.Backward/Forward is used for parameterised variants but FromEnd is clearest for standalone fns). Co-authored-by: Copilot <[email protected]>
9 tasks
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.
🤖 This is an automated PR from Repo Assist.
Closes #256
Summary
This PR implements the feature requested in #256: a variant of
Series.windowWhile/Series.chunkWhilewhere the key of each window/chunk is its last element (i.e., windows anchored at the end rather than the start).New API
Series.windowWhileFromEnd/Series.windowWhileIntoFromEndFor each key
k, produces the window ending atkthat extends back as far ascond(startKey, k)returnstrue. The key of each output window is the last (end) element.Series.chunkWhileFromEnd/Series.chunkWhileIntoFromEndSame non-overlapping chunking as
chunkWhile, but each chunk is keyed by its last element instead of its first.