Skip to content

tidy_summary: linear quantile interpolation (queued for 0.1.1)#21

Merged
ismayc merged 4 commits into
mainfrom
chore/tidy-summary-linear-quantile
Jun 22, 2026
Merged

tidy_summary: linear quantile interpolation (queued for 0.1.1)#21
ismayc merged 4 commits into
mainfrom
chore/tidy-summary-linear-quantile

Conversation

@ismayc

@ismayc ismayc commented Jun 21, 2026

Copy link
Copy Markdown
Member

Adds an interpolation="linear" parameter to tidy_summary (new default).

Why: polars .quantile() defaults to "nearest", which diverges from R's quantile() (type 7), NumPy, and the quartiles drawn by Plotly/ggplot2 boxplots. With "linear", tidy_summary's Q1/Q3 match the standard textbook/R convention and the boxplots shown beside them in the book. Pass interpolation="nearest" to restore prior behavior.

Full test suite passes at 100% coverage (322 tests).

Do not release yet — holding off since 0.1.0 was just published. Queue for 0.1.1.

🤖 Generated with Claude Code

polars `.quantile()` defaults to "nearest", which diverges from R's quantile()
(type 7), NumPy, and the quartiles drawn by Plotly/ggplot2 boxplots. Add an
`interpolation="linear"` parameter (new default) so tidy_summary's five-number
summary matches the standard textbook/R convention and the boxplots shown beside
it. Pass interpolation="nearest" to restore the old behavior.

Queued for the next release (0.1.1) — not yet published.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@codecov

codecov Bot commented Jun 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (bb8408d) to head (2d194c5).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main       #21   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         1546      1546           
=========================================
  Hits          1546      1546           
Files with missing lines Coverage Δ
moderndive/infer/wrappers.py 100.00% <100.00%> (ø)
moderndive/modeling.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ismayc and others added 3 commits June 21, 2026 09:53
R's chisq.test and this package's prop_test both default to Yates' continuity
correction; chisq_test previously hardcoded correction=False, an inconsistency.
Add a `correct: bool = True` parameter (applied only to 2x2 tables, like R and
scipy); pass correct=False for the uncorrected Pearson statistic that matches the
simulation-based calculate(stat="Chisq"). 322 tests pass at 100% coverage.

Queued for 0.1.1 — not yet released.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…aults)

Both additions previously flipped a default, changing results for existing 0.1.0
users. Revert the defaults to 0.1.0 behavior and keep the new behavior opt-in:

- tidy_summary(interpolation=): default back to "nearest"; pass "linear" for
  R's quantile() type 7 / Plotly/ggplot2 boxplot quartiles.
- chisq_test(correct=): default back to False (uncorrected Pearson, matching
  calculate(stat="Chisq")); pass correct=True for R's chisq.test/prop_test.

Both are now purely additive (new opt-in parameters) and safe for a 0.1.1 patch.
Also document a CHANGELOG/RELEASING convention requiring any breaking change to
get a dedicated "⚠️ Breaking changes" section and a non-patch version bump.

322 tests, 100% coverage, ruff clean.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_017CTL1QSTg1DmDUpqYuPEog
@ismayc ismayc merged commit 22acee7 into main Jun 22, 2026
8 checks passed
@ismayc ismayc deleted the chore/tidy-summary-linear-quantile branch June 22, 2026 15:14
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.

1 participant