Skip to content

Include tied observations in the empirical CDF - #259

Merged
mmore500 merged 1 commit into
jeetsukumaran:mainfrom
antonsoo:fix/inclusive-empirical-cdf
Oct 24, 2026
Merged

mmore500 merged 1 commit into
jeetsukumaran:mainfrom
antonsoo:fix/inclusive-empirical-cdf

Conversation

@antonsoo

Copy link
Copy Markdown
Contributor

empirical_cdf() documents the proportion of observations <= v, but currently counts only observations < v. For [1, 2, 2, 3], querying 2 returns 0.25 instead of 0.75; querying the sample maximum also fails to return 1.

Include equal observations and add regressions for ties, a constant sample, unsorted input and thresholds outside the sample range. A separate check covers 630 queries against the bundled BEAST/MrBayes posterior samples using sorted ranks as the reference. The Python suites pass on 3.12 and 3.8 with optional PAUP interoperability disabled, and the configured linter passes.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.13%. Comparing base (6a628f4) to head (eb7e47e).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #259   +/-   ##
=======================================
  Coverage   89.12%   89.13%           
=======================================
  Files         116      116           
  Lines       13366    13375    +9     
=======================================
+ Hits        11913    11922    +9     
  Misses       1453     1453           
Flag Coverage Δ
unittests 89.13% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mmore500 mmore500 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, simple fix, this function isn’t used elsewhere in the library. Could change the docstring and keep current behavior, but new behavior is more correct.

@mmore500

Copy link
Copy Markdown
Collaborator

Merging, thank you @antonsoo !

@mmore500
mmore500 merged commit ebb69ba into jeetsukumaran:main Oct 24, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants