Skip to content

Unify density-control argument defaults#538

Open
utkarshpawade wants to merge 2 commits intostan-dev:masterfrom
utkarshpawade:fix/131/density-defaults
Open

Unify density-control argument defaults#538
utkarshpawade wants to merge 2 commits intostan-dev:masterfrom
utkarshpawade:fix/131/density-defaults

Conversation

@utkarshpawade
Copy link
Copy Markdown
Contributor

@utkarshpawade utkarshpawade commented Apr 12, 2026

Fixes #131
Unifies density-control defaults across the ppc_* / ppd_* density-overlay functions with the mcmc_areas* / mcmc_dens* family.

  • ppc_dens_overlay(), ppc_dens_overlay_grouped(), ppd_dens_overlay(): bw, adjust, kernel, n_dens defaults changed from hard-coded values to NULL, with %||% fallbacks applied internally.
  • compute_interval_density(): %||% fallbacks extended to bw/adjust/kernel.
  • args-density-controls template: documents all four defaults.
  • Regenerated .Rd files.

Behavior is preserved. NULL resolves to the previously hard-coded values.

Copilot AI review requested due to automatic review settings April 12, 2026 06:47
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 standardizes how density-control arguments (bw, adjust, kernel, n_dens) are defaulted across PPC/PPD density-overlay functions to match the broader “density-like” plotting API, by switching user-facing defaults to NULL and applying internal %||% fallbacks to preserve existing behavior.

Changes:

  • Updated ppc_dens_overlay(), ppc_dens_overlay_grouped(), and ppd_dens_overlay() to default density controls to NULL and set effective defaults internally.
  • Extended compute_interval_density() to apply %||% fallbacks for bw/adjust/kernel.
  • Updated shared roxygen template + regenerated .Rd files; added a NEWS entry.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
R/ppd-distributions.R Switches ppd_dens_overlay() density-control defaults to NULL with internal fallbacks.
R/ppc-distributions.R Switches ppc_dens_overlay*() density-control defaults to NULL with internal fallbacks (via ppc_dens_overlay()).
R/mcmc-intervals.R Adds `%
man-roxygen/args-density-controls.R Updates the shared parameter documentation for density controls.
man/PPD-distributions.Rd Regenerated docs reflecting the updated defaults and parameter text.
man/PPC-distributions.Rd Regenerated docs reflecting the updated defaults and parameter text.
man/MCMC-intervals.Rd Regenerated docs reflecting the updated density-controls template text.
man/MCMC-distributions.Rd Regenerated docs reflecting the updated density-controls template text.
NEWS.md Notes the change in defaults to NULL for affected functions.

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

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.15%. Comparing base (44c3e5c) to head (8012e75).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #538   +/-   ##
=======================================
  Coverage   99.15%   99.15%           
=======================================
  Files          35       35           
  Lines        5920     5931   +11     
=======================================
+ Hits         5870     5881   +11     
  Misses         50       50           

☔ 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.

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.

unify argument defaults for density-like plots

3 participants