Skip to content

test-related fixes #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 8, 2019
Merged

test-related fixes #181

merged 5 commits into from
Apr 8, 2019

Conversation

tjmahr
Copy link
Collaborator

@tjmahr tjmahr commented Apr 8, 2019

The changes here are general improvements for our unit tests.

  • Regenerated visual tests to support vdiffr 0.3.0

  • Added visual tests for mcmc_trace(), mcmc_trace_highlight(), and mcmc_trace(np = ...) (trace with rug-plot of divergences). I added these so that I can see if my changes to mcmc_trace() in Rank histogram #179 affect plot rendering.

  • Fixed problem causing test for mcmc_recover_scatter() to fail.

    This plot gives each facet the same range for x and y. (We want this setup when we are comparing true values to estimates of the true value.) Before the function set the range by pulling the computed ranges from the prebuilt plot, which broke the tests after a ggplot2 update. We now fix this by computing the ranges beforehand and enforcing the ranges by plotting them invisibly with geom_blank()

  • Added a visual test to ppc_violin_grouped()

The tests all run cleanly except for alpha-related warnings and a warning about my R version. The alpha ones are fixed in my changes in #179.

==> devtools::test()

Loading bayesplot
This is bayesplot version 1.6.0.9000
- Online documentation and vignettes at mc-stan.org/bayesplot
- bayesplot theme set to bayesplot::theme_default()
   * Does _not_ affect other ggplot2 plots
   * See ?bayesplot_theme_set for details on theme setting
Testing bayesplot
v | OK F W S | Context
v | 88       | Aesthetics [0.4 s]
v | 18       | available_mcmc and available_ppc
v | 14       | bayesplot_grid [0.4 s]
v | 51       | Convenience functions (for ggplot objects) [0.1 s]
v | 18       | Example draws
v | 27       | Extractors [0.3 s]
v | 76       | MCMC: misc. functions [0.1 s]
v | 161       | PPC: misc. functions [0.2 s]
v | 20       | Shared: misc. functions
v | 13       | MCMC: combo [2.4 s]
v | 43   1   | MCMC: diagnostics [7.6 s]
--------------------------------------------------------
test-mcmc-diagnostics.R:86: warning: mcmc_rhat renders correctly
package 'gdtools' was built under R version 3.5.3
--------------------------------------------------------
v | 40       | MCMC: distributions [3.5 s]
v | 77       | MCMC: intervals [12.8 s]
v | 27       | MCMC: nuts [1.9 s]
v | 19       | MCMC: recover [1.3 s]
v | 96       | MCMC: scatter and parallel coordinates plots [5.0 s]
v | 38   5   | MCMC: traces [5.2 s]
--------------------------------------------------------
test-mcmc-traces.R:22: warning: mcmc_trace_highlight returns a ggplot object
Using alpha for a discrete variable is not advised.

test-mcmc-traces.R:23: warning: mcmc_trace_highlight returns a ggplot object
Using alpha for a discrete variable is not advised.

test-mcmc-traces.R:116: warning: mcmc_trace_highlight renders correctly
Using alpha for a discrete variable is not advised.

test-mcmc-traces.R:122: warning: mcmc_trace_highlight renders correctly
Using alpha for a discrete variable is not advised.

test-mcmc-traces.R:128: warning: mcmc_trace_highlight renders correctly
Using alpha for a discrete variable is not advised.
--------------------------------------------------------
v |  4       | PPC: pp_check generic and default method [0.5 s]
v | 13       | PPC: discrete [0.8 s]
v | 40       | PPC: distributions [11.9 s]
v | 18       | PPC: predictive errors [1.1 s]
v | 31       | PPC: input validation
v | 35       | PPC: intervals & ribbon [5.5 s]
v | 29       | PPC: loo [1.7 s] ribbon
v | 11       | PPC: scatterplots [0.2 s]
v | 25       | PPC: test-statistics [1.0 s]

== Results =============================================
Duration: 66.1 s

OK:       1032
Failed:   0
Warnings: 8
Skipped:  0

tjmahr and others added 5 commits February 2, 2018 15:55
Merge branch 'master' of https://github.com/stan-dev/bayesplot into vdiffs

# Conflicts:
#	tests/testthat/test-ppc-distributions.R
mcmc_recover_scatter() no longer determines x,y range peeking at a prebuilt plot
@tjmahr
Copy link
Collaborator Author

tjmahr commented Apr 8, 2019

This pull request closes #156, #180

Copy link
Member

@jgabry jgabry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks TJ!

@jgabry jgabry merged commit a05ee8a into master Apr 8, 2019
@jgabry jgabry deleted the vdiffs branch April 8, 2019 22:54
@jgabry jgabry added the tests label May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants