Add unified wrapper functions for plot families#438
Open
ishaan-arora-1 wants to merge 1 commit intostan-dev:masterfrom
Open
Add unified wrapper functions for plot families#438ishaan-arora-1 wants to merge 1 commit intostan-dev:masterfrom
ishaan-arora-1 wants to merge 1 commit intostan-dev:masterfrom
Conversation
Introduce high-level wrapper functions that consolidate related plotting functions into single entry points with a `type` argument: - ppc_error(), ppc_dist(), ppc_discrete(), ppc_loo() - ppd_dist() - mcmc_dist(), mcmc_trace_w(), mcmc_diag(), mcmc_nuts(), mcmc_recover() Each wrapper dispatches to the underlying function (e.g., ppc_dist(type = "hist") calls ppc_hist()). Wrappers that have grouped variants accept a `grouped` flag. Fixes stan-dev#433
Member
|
Let's wait on this until we've had a chance to discuss in #433 |
Member
|
In general for things like this that require discussion we should wait to open PRs until we've had the discussion and agreed on the new design. For things like fixing deprecations or fixing documentation (or other things like that that don't require discussion) it's ok to just open the PR. |
Contributor
Author
Alright, thankyou for the feedback!! Will keep in mind. |
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.
Fixes #433
This adds high-level wrapper functions that let users access each plot family through a single function +
typeargument, instead of needing to know the exact function name upfront.New wrappers
PPC:
ppc_error(),ppc_dist(),ppc_discrete(),ppc_loo()PPD:
ppd_dist()MCMC:
mcmc_dist(),mcmc_trace_w(),mcmc_diag(),mcmc_nuts(),mcmc_recover()For example, instead of remembering
ppc_dens_overlay()vsppc_ecdf_overlay()vsppc_hist(), users can call:Partial matching on
typeis supported. Families with_groupedvariants acceptgrouped = TRUE. All other arguments are forwarded via....The underlying functions remain fully available — these wrappers are thin dispatchers that just make the API a bit more discoverable.
What's included
R/wrappers.R— all wrapper implementations with a shared.dispatch()helperman/bayesplot-wrappers.Rd— consolidated docs listing valid types per familytests/testthat/test-wrappers.R— tests covering dispatch, grouped variants, error cases, and partial matchingNEWS.mdandNAMESPACEupdated