tidy_summary: linear quantile interpolation (queued for 0.1.1)#21
Merged
Conversation
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 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #21 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 1546 1546
=========================================
Hits 1546 1546
🚀 New features to boost your workflow:
|
…ation Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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 <noreply@anthropic.com>
…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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017CTL1QSTg1DmDUpqYuPEog
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.
Adds an
interpolation="linear"parameter totidy_summary(new default).Why: polars
.quantile()defaults to"nearest", which diverges from R'squantile()(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. Passinterpolation="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