Skip to content

Use geom_step() as default in ppc_ecdf_overlay() and deprecate discrete argument#533

Merged
jgabry merged 7 commits intostan-dev:masterfrom
utkarshpawade:fix/ecdf-geom-step-259
Apr 8, 2026
Merged

Use geom_step() as default in ppc_ecdf_overlay() and deprecate discrete argument#533
jgabry merged 7 commits intostan-dev:masterfrom
utkarshpawade:fix/ecdf-geom-step-259

Conversation

@utkarshpawade
Copy link
Copy Markdown
Contributor

Fixes #259

The ECDF is a step function by definition, regardless of whether the data is continuous or discrete. ppc_km_overlay() already hard-codes geom_step() for the same reason. This PR makes ppc_ecdf_overlay() consistent.

Changes

  • ppc_ecdf_overlay(), ppc_ecdf_overlay_grouped(), and ppd_ecdf_overlay() now always use geom = "step" in stat_ecdf()
  • The discrete argument is deprecated via lifecycle::deprecate_warn()
  • Updated roxygen documentation and examples
  • Regenerated vdiffr snapshots
  • Added deprecation and no-warning tests

before
after

Copilot AI review requested due to automatic review settings April 8, 2026 12:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates ECDF overlay plots to always render as step functions (consistent with the ECDF definition) and deprecates the discrete argument across related PPC/PPD helpers.

Changes:

  • Hard-code geom = "step" in ppc_ecdf_overlay(), ppc_ecdf_overlay_grouped(), and ppd_ecdf_overlay().
  • Deprecate the discrete argument using lifecycle::deprecate_warn().
  • Update tests and vdiffr snapshots to reflect the new default rendering and to assert deprecation behavior.

Reviewed changes

Copilot reviewed 4 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
R/ppc-distributions.R Switch ECDF overlays to step geom unconditionally; add deprecation warning and doc updates.
R/ppd-distributions.R Switch PPD ECDF overlay to step geom unconditionally; add deprecation warning.
tests/testthat/test-ppc-distributions.R Update vdiffr labels and add tests for deprecation + no-warning behavior when discrete isn’t supplied.
tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-default.svg Regenerate snapshot for step-function ECDF rendering.
tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-size-alpha.svg Regenerate snapshot and update title text.
tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-grouped-default.svg Regenerate snapshot for grouped step-function ECDF rendering.
tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-grouped-size-alpha.svg Regenerate snapshot and update title text.
NEWS.md Document the behavior change and discrete deprecation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.15%. Comparing base (83ad3ef) to head (c5a85b7).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #533      +/-   ##
==========================================
- Coverage   99.18%   99.15%   -0.04%     
==========================================
  Files          35       35              
  Lines        5903     5920      +17     
==========================================
+ Hits         5855     5870      +15     
- Misses         48       50       +2     

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Member

@jgabry jgabry left a comment

Choose a reason for hiding this comment

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

Thanks, I agree it makes sense to just always use geom_step

@jgabry jgabry merged commit 44c3e5c into stan-dev:master Apr 8, 2026
6 checks passed
@utkarshpawade utkarshpawade deleted the fix/ecdf-geom-step-259 branch April 9, 2026 05:22
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.

ppc_ecdf_overlay(): geom = "step"

4 participants