Skip to content

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

Open
utkarshpawade wants to merge 2 commits intostan-dev:masterfrom
utkarshpawade:fix-ppc-distribution-docs-and-test
Open

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

Conversation

@utkarshpawade
Copy link

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

2 participants