Skip to content

Fix ppc-distribution docs for argument usage & correct test function (#366)#424

Merged
jgabry merged 2 commits intostan-dev:masterfrom
utkarshpawade:fix-ppc-distribution-docs-and-test
Feb 27, 2026
Merged

Fix ppc-distribution docs for argument usage & correct test function (#366)#424
jgabry merged 2 commits intostan-dev:masterfrom
utkarshpawade:fix-ppc-distribution-docs-and-test

Conversation

@utkarshpawade
Copy link
Contributor

Fixes #366

This PR addresses the documentation and testing issues in ppc-distribution:

Documentation improvements:

  • Clarified that binwidth, bins, and breaks arguments are passed to ggplot2::geom_area() and ggdist::stat_dots() in addition to ggplot2::geom_histogram()
  • Clarified that freq argument applies to frequency polygons in addition to histograms

Test fix:

  • Fixed test in test-ppc-distributions.R that incorrectly used ppc_dens() instead of ppd_dens() when testing PPD versions of functions

Testing:

  • All tests in test-ppc-distributions.R pass (111 PASS | 0 FAIL)
  • All documented functions work correctly with the updated parameters
  • Documentation regenerated successfully

Copy link

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 attempts to fix documentation and testing issues in the bayesplot package related to PPC distribution functions. The PR correctly identifies and fixes a test bug, and correctly updates the freq parameter documentation. However, it introduces critical inaccuracies in the documentation for binwidth, bins, and breaks parameters.

Changes:

  • Fixed test function that incorrectly used ppc_dens() instead of ppd_dens() for PPD function testing
  • Updated freq parameter documentation to clarify it applies to frequency polygons in addition to histograms
  • Attempted to update binwidth, bins, and breaks parameter documentation (but with inaccuracies)

Reviewed changes

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

Show a summary per file
File Description
tests/testthat/test-ppc-distributions.R Correctly fixes test to use ppd_dens() instead of ppc_dens() when testing PPD versions
man-roxygen/args-hist-freq.R Correctly updates freq parameter documentation to include frequency polygons
man-roxygen/args-hist.R Attempts to document binwidth, bins, breaks for multiple geoms, but contains critical inaccuracies
man/*.Rd Regenerated documentation files reflecting the changes in the templates
NEWS.md Documents the changes made in this PR

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

Address Copilot review feedback:
- bins parameter now only mentions geom_histogram() and geom_area()
- breaks parameter now only mentions geom_histogram()
- Removed incorrect references to stat_dots() which doesn't support bins/breaks
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.63%. Comparing base (306c92e) to head (57b0cc1).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #424      +/-   ##
==========================================
- Coverage   98.66%   98.63%   -0.04%     
==========================================
  Files          35       35              
  Lines        5860     5860              
==========================================
- Hits         5782     5780       -2     
- Misses         78       80       +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.

@jgabry
Copy link
Member

jgabry commented Feb 27, 2026

Thanks, this looks good. The unit tests are failing on ubuntu-latest (devel) but sometimes this happens on r-devel. We have visual tests that compare SVGs and they are very sensitive. Nothing here should affect those, so we can merge this.

@jgabry jgabry merged commit 93cc02d into stan-dev:master Feb 27, 2026
5 of 6 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.

fix ppc-distribution docs for argument usage & correct test function in test-ppc-distribution

4 participants