Repository navigation
feat: add StdDev, StdDevPop, Var, VarPop and DistinctCount summary types (#389) - #516
Open
michaelstonis wants to merge 1 commit into
Open
michaelstonis wants to merge 1 commit into
michaelstonis wants to merge 1 commit into
Conversation
8 of 10 tasks
Comment on lines
+475
to
+483
| foreach (var city in Cities) | ||
| { | ||
| var path = $"{nameof(Item.City)}={city}"; | ||
| var fg = foreground.GetGroupSummaries(path)![0]; | ||
| var bg = background.GetGroupSummaries(path)![0]; | ||
| Assert.Equal(fg.GetRawValue(nameof(Item.Quantity), SummaryType.StdDev), bg.GetRawValue(nameof(Item.Quantity), SummaryType.StdDev)); | ||
| Assert.Equal(fg.GetRawValue(nameof(Item.Quantity), SummaryType.DistinctCount), bg.GetRawValue(nameof(Item.Quantity), SummaryType.DistinctCount)); | ||
| Assert.Equal(foreground.GetCaptionSummaryText(path), background.GetCaptionSummaryText(path)); | ||
| } |
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.
Closes #389.
Changes
SummaryTypegainsStdDev = 6,StdDevPop = 7,Var = 8,VarPop = 9andDistinctCount = 10, appended afterCustom(existing members now carry explicit values 0 to 5, which are the same numbers they always had).PropertyAggregate(SummaryAggregates.cs): Welford's streaming mean and M2 indoublefor the four statistics (decimal and every built-in numeric type converted; nulls and non-numbers skipped without exceptions). Sample variants are empty for fewer than two numbers, population variants for zero numbers (one number gives 0). Results are clamped at 0.DistinctCount: aHashSet<object>withGroupKeyComparerover the source's text comparer, so it matches grouping. Allocated once per aggregate, cleared byBegin()between passes, and rebuilt only if the source'sKumikoComparerinstance changes (culture orStringCompareOptionschange).CanUpdateInPlaceis false, so table and group summaries recompute (foreground or background) instead of adjusting in place. Table, group and caption summaries and the worker path all go through the same aggregate type, so no other code changed.KumikoStrings: five new init properties with defaults, andSummaryLabelhandles them.Public API (all in
src/KumikoUI.Core/PublicAPI.Unshipped.txt):SummaryType.StdDev,StdDevPop,Var,VarPop,DistinctCount;KumikoStrings.SummaryStdDev,SummaryStdDevPop,SummaryVar,SummaryVarPop,SummaryDistinctCount(get and init). The Unshipped lines were added by hand becauseeng/update-public-api.shran but itsdotnet formatstep produced no output in this environment (it left the file empty); the lines follow the format of the Shipped file.Acceptance criteria
SummaryStatisticsTests, including a 1e9-offset stability case and huge values).SummaryStatisticsTests,BackgroundRebuildTests.StatisticsAndDistinctCount_OnTheWorker_...).DistinctCountfollows the source's string comparison (ignore-case, ordinal, and a runtime change).KumikoStrings;LocalizationTestsupdated (the German table and the label test).SummaryTypeis bound through the existingSummaryColumnDescriptionin XAML on both hosts, so no host change was needed. Not built or tested on the hosts.PublicAPI.Unshipped.txtupdated (by hand, see above).Verification
dotnet test tests/KumikoUI.Core.Tests: 4386 passed, 5 skipped, 0 failed.dotnet test tests/KumikoUI.Export.Excel.Tests: 127 passed.dotnet test tests/KumikoUI.SkiaSharp.Tests: 42 passed.dotnet build src/KumikoUI.Coreandsrc/KumikoUI.SkiaSharp: 0 warnings, 0 errors.