Skip to content

[repo-assist] fix: Seq.meanTruncatedBy trims both ends - #392

Merged
bvenn merged 3 commits into
developerfrom
repo-assist/fix-meanTruncatedBy-20261002-6bd24efb3332f974
Oct 11, 2026
Merged

bvenn merged 3 commits into
developerfrom
repo-assist/fix-meanTruncatedBy-20261002-6bd24efb3332f974

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

🤖 This is an automated PR from Repo Assist.

Root cause: Seq.meanTruncatedBy skipped k values from the low end but then took n - k elements, so the high end was never trimmed. It also used floor, whereas meanTruncated truncates via int. Its documented example result (7.0) was also wrong.

Fix: use Seq.take (n - 2 * k) so both ends are trimmed, matching meanTruncated. The doc example is corrected to 6.0 (keeps 2,3,4, doubled mean).

Tests: new Seq.meanTruncatedBy tests cover both-end trimming, equivalence with meanTruncated, and a zero proportion.

Behaviour change: meanTruncatedBy results change for proportion > 0. This is a bug fix, but maintainers should be aware.

Test Status

  • Build (Release): ✅
  • dotnet test --filter meanTruncated: ✅ 10/10. The Seq filter: ✅ 359/359.
  • Full ./build.sh RunTests was not run.

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • api.nuget.org
  • dc.services.visualstudio.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "api.nuget.org"
    - "dc.services.visualstudio.com"

See Network Configuration for more information.

Generated by 🌈 Repo Assist, see workflow run. Learn more.
Comment /repo-assist to run again

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@5d11aa2a05ce2c943c085acb7b12b583f83ed375

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme
dsyme marked this pull request as ready for review October 6, 2026 22:17
@bvenn bvenn added the bug label Oct 11, 2026
@bvenn
bvenn merged commit c38f329 into developer Oct 11, 2026
2 checks passed
@bvenn
bvenn deleted the repo-assist/fix-meanTruncatedBy-20261002-6bd24efb3332f974 branch October 11, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants