Conversation
…apRows, MapCols Closes #207 Adds the following C# extension methods that were missing from the public API: SeriesExtensions: - WindowWhile(cond) - sliding windows based on a key condition - WindowWhileInto(cond, reduce) - sliding windows with aggregation - ChunkWhile(cond) - non-overlapping chunks based on a key condition - ChunkWhileInto(cond, reduce) - non-overlapping chunks with aggregation - PairwiseWith(f) - apply a function to each consecutive pair of values FrameExtensions: - MapRows(f) - map each row to a value, returning Series<R,V> - MapCols(f) - transform each column, returning a new Frame<R,C> All new methods delegate to the existing F# Series/Frame module functions. Tests added to Deedle.CSharp.Tests. Co-authored-by: Copilot <[email protected]>
…-cleanup-ef1b9bc0d09550f9
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.
🤖 Repo Assist — automated PR in response to @dsyme's request on #207.
Closes #207
Summary
Implements the C# API cleanup requested in #207. Adds the missing C# extension methods so that the windowing, chunking, and pairwise operations exposed in the F#
Seriesmodule are also accessible from C#.New extensions
SeriesExtensionsWindowWhile(Func(K,K,bool))WindowWhileInto(Func(K,K,bool), Func(Series<K,V),U>)ChunkWhile(Func(K,K,bool))ChunkWhileInto(Func(K,K,bool), Func(Series<K,V),U>)PairwiseWith(Func(K,T,T,U))FrameExtensionsMapRows(Func(R, ObjectSeries<C), V>)Series(R,V)MapCols(Func(C, ObjectSeries<R), ObjectSeries(R)>)Frame(R,C)All methods are thin wrappers delegating to the existing F#
Series.*/Frame.*functions.Design notes
windowDist/chunkDist) is intentionally omitted from the C# API: those F# functions use SRTP arithmetic constraints that cannot be expressed in non-inline F# or C# code. Users can achieve the same result withWindowWhile/ChunkWhileand a subtraction condition in the lambda.PairwiseWithtakesFunc(K, T, T, U)(key + two values) rather thanFunc(K, Tuple<T,T), U>, which is more idiomatic for C# callers.Test status
dotnet test tests/Deedle.CSharp.Tests/→ 29/29 passed (5 new tests added)dotnet test tests/Deedle.Tests/→ 676/676 passeddotnet build src/Deedle/Deedle.fsproj -c Release→ 0 errors, 0 new warnings