Skip to content

Conversation

@behramulukir
Copy link
Collaborator

This PR adds mcmc_dots and mcmc_dots_by_chain functions which were requested by @avehtari.

These functions are simply an adaptation of the previously implemented ppc_dots function to the MCMC space. As ppc_dots does, these functions require ggdist to be installed, so it checks whether that is installed, and if it is, then it utilises ggdist::stat_dots to create dot plots.

Tasks:

  • implement functions
  • implement tests
  • update documentation

Examples

x <- example_mcmc_draws()
color_scheme_set("brightblue")

mcmc_dots(x)
mcmc_dots(x)
mcmc_dots(x, quantiles = 80)
mcmc_dots(x,quantiles=80)
mcmc_dots_by_chain(x, regex_pars = "beta")
mcmc_dots_by_chain(x,regex_pars=beta)

@behramulukir behramulukir self-assigned this Dec 19, 2025
@behramulukir behramulukir marked this pull request as ready for review December 19, 2025 22:25
@behramulukir behramulukir marked this pull request as draft December 22, 2025 09:48
@behramulukir behramulukir force-pushed the mcmc_dots branch 2 times, most recently from 0fd6519 to 5a8f29f Compare December 22, 2025 10:19
@jgabry
Copy link
Member

jgabry commented Dec 22, 2025

Do you know why two of the new visual tests are failing? Maybe you just need to regenerate the snapshots?

══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-mcmc-distributions.R:218:3'): mcmc_dots renders correctly ────
Snapshot of `testcase` has changed.

Backtrace:
    ▆
 1. └─vdiffr::expect_doppelganger("mcmc_dots (default)", p_base) at test-mcmc-distributions.R:218:3
 2.   ├─base::withCallingHandlers(...)
 3.   └─testthat::expect_snapshot_file(...)
── Failure ('test-mcmc-distributions.R:227:3'): mcmc_dots_by_chain renders correctly ──
Snapshot of `testcase` has changed.

Backtrace:
    ▆
 1. └─vdiffr::expect_doppelganger("mcmc_dots_by_chain (default)", p_base) at test-mcmc-distributions.R:227:3
 2.   ├─base::withCallingHandlers(...)
 3.   └─testthat::expect_snapshot_file(...)

@jgabry
Copy link
Member

jgabry commented Dec 22, 2025

I just regenerated the SVGs and pushed them. Let's see if it passes now.

@codecov-commenter
Copy link

codecov-commenter commented Dec 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.64%. Comparing base (d6e83fd) to head (108e6e7).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #402      +/-   ##
==========================================
+ Coverage   98.62%   98.64%   +0.01%     
==========================================
  Files          35       35              
  Lines        5750     5811      +61     
==========================================
+ Hits         5671     5732      +61     
  Misses         79       79              

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

@behramulukir
Copy link
Collaborator Author

Sorry that I wasn't able to get back to this soon. In this commit, I attempted to re-run test-mcmc-distributions.R and update the SVGs, but this resulted in all visual tests failing, so I had to revert to the previous commit.

Now with your update, everything looks okay to me, and tests pass as well, so I'll mark this PR as ready.

@behramulukir behramulukir marked this pull request as ready for review December 24, 2025 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants