Skip to content

Commit f583673

Browse files
authored
Merge pull request #404 from stan-dev/master
Update branch
2 parents 8c69b5d + d6e83fd commit f583673

33 files changed

Lines changed: 80 additions & 139 deletions

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ images/*
1414
book/*
1515
docs/*
1616
Rplots.pdf
17+
.vscode/*
1718
^\.github$
1819
^release-prep\.R$
20+
release-prep.R

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ revdep/*
1313
CRAN-RELEASE
1414
CRAN-SUBMISSION
1515
release-prep.R
16+
17+
# vscode/positron/etc settings
18+
.vscode/*

DESCRIPTION

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: bayesplot
22
Type: Package
33
Title: Plotting for Bayesian Models
4-
Version: 1.14.0.9000
5-
Date: 2025-08-31
4+
Version: 1.15.0.9000
5+
Date: 2025-12-11
66
Authors@R: c(person("Jonah", "Gabry", role = c("aut", "cre"), email = "jgabry@gmail.com"),
77
person("Tristan", "Mahr", role = "aut", comment = c(ORCID = "0000-0002-8890-5116")),
88
person("Paul-Christian", "Bürkner", role = "ctb"),
@@ -12,7 +12,8 @@ Authors@R: c(person("Jonah", "Gabry", role = c("aut", "cre"), email = "jgabry@gm
1212
person("Eduardo", "Coronado Sroka", role = "ctb"),
1313
person("Teemu", "Sailynoja", role = "ctb"),
1414
person("Aki", "Vehtari", role = "ctb"),
15-
person("Behram", "Ulukır", role = "ctb"))
15+
person("Behram", "Ulukır", role = "ctb"),
16+
person("Visruth", "Srimath Kandali", role = "ctb"))
1617
Maintainer: Jonah Gabry <jgabry@gmail.com>
1718
Description: Plotting functions for posterior analysis, MCMC diagnostics,
1819
prior and posterior predictive checks, and other visualizations
@@ -56,9 +57,10 @@ Suggests:
5657
scales,
5758
shinystan (>= 2.3.0),
5859
survival,
59-
testthat (>= 2.0.0),
60+
testthat (>= 3.0.0),
6061
vdiffr (>= 1.0.2)
6162
RoxygenNote: 7.3.3
6263
VignetteBuilder: knitr
6364
Encoding: UTF-8
6465
Roxygen: list(markdown = TRUE)
66+
Config/testthat/edition: 3

NEWS.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
# bayesplot (development version)
22

3-
* Add `shape` argument to `mcmc_scatter()` by @behramulukir (#375)
4-
* Restore pre ggplot2 v4.0 behavior of bayesplot theme setting (#385)
3+
# bayesplot 1.15.0
4+
5+
* Add `shape` argument to `mcmc_scatter` by @behramulukir (#375)
6+
* Restore pre ggplot2 v4.0 behavior of bayesplot theme setting by @jgabry (#385)
7+
* New pkgdown theme by @VisruthSK in (#378)
8+
* Testthat 3e by @VisruthSK (#397)
9+
* Update loo PIT visual tests by @jgabry (#374)
10+
* Update SVGs for visual tests for ggplot2 v4.0 by @jgabry (#379)
11+
* Bumped roxygen and fixed linking note by @VisruthSK (#382)
12+
* Fix height/width attributes in Rd files for CRAN by @jgabry (#387)
13+
514

615
# bayesplot 1.14.0
716

R/bayesplot-package.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@
104104
# release reminders (for devtools)
105105
release_questions <- function() {
106106
c(
107-
"Have you reduced the size of the vignettes for CRAN?",
108107
"Have you tested with '^tests/testthat/_snaps$' removed from .Rbuildignore?",
109108
"Have you put '^tests/testthat/_snaps$' back in .Rbuildignore? before submitting?"
110109
)

man/bayesplot-package.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-aesthetics.R

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
library(bayesplot)
2-
context("Aesthetics")
3-
4-
51
# color scheme stuff ------------------------------------------------------
62

73
prepare_colors_for_test <- function(scheme) {
@@ -13,13 +9,13 @@ prepare_colors_for_test <- function(scheme) {
139

1410
test_that("getting and setting the color scheme works", {
1511
color_scheme_set("red")
16-
expect_equivalent(color_scheme_get(), prepare_colors_for_test("red"))
12+
expect_equal(color_scheme_get(), prepare_colors_for_test("red"), ignore_attr = TRUE)
1713
expect_named(prepare_colors_for_test("blue"), scheme_level_names())
1814
expect_named(color_scheme_get(), scheme_level_names())
1915
for (clr in names(master_color_list)) {
2016
color_scheme_set(clr)
21-
expect_equivalent(color_scheme_get(), prepare_colors_for_test(clr),
22-
info = clr)
17+
expect_equal(color_scheme_get(), prepare_colors_for_test(clr),
18+
info = clr, ignore_attr = TRUE)
2319
expect_named(color_scheme_get(), scheme_level_names())
2420
}
2521

@@ -28,7 +24,7 @@ test_that("getting and setting the color scheme works", {
2824
expect_gg(plot(color_scheme_get("mix-blue-green")))
2925

3026
color_scheme_set("blue")
31-
expect_equivalent(color_scheme_get("teal"), prepare_colors_for_test("teal"))
27+
expect_equal(color_scheme_get("teal"), prepare_colors_for_test("teal"), ignore_attr = TRUE)
3228

3329
# error if not character
3430
expect_error(color_scheme_set(7), "'scheme' should be a character vector of length 1 or 6")
@@ -60,10 +56,10 @@ test_that("color_scheme_get with i argument works", {
6056

6157
test_that("setting mixed scheme works", {
6258
color_scheme_set("mix-gray-blue")
63-
expect_equivalent(color_scheme_get(), mixed_scheme("gray", "blue"))
59+
expect_equal(color_scheme_get(), mixed_scheme("gray", "blue"), ignore_attr = TRUE)
6460

6561
color_scheme_set("mix-blue-gray")
66-
expect_equivalent(color_scheme_get(), mixed_scheme("blue", "gray"))
62+
expect_equal(color_scheme_get(), mixed_scheme("blue", "gray"), ignore_attr = TRUE)
6763

6864
expect_error(color_scheme_set("mix-green-reds"), "should be one of")
6965
expect_error(color_scheme_set("mix-greens-red"), "should be one of")
@@ -72,9 +68,9 @@ test_that("setting mixed scheme works", {
7268
test_that("setting brewer scheme works", {
7369
skip_if_not_installed("RColorBrewer")
7470
color_scheme_set("brewer-Blues")
75-
expect_equivalent(unlist(color_scheme_get()), RColorBrewer::brewer.pal(6, "Blues"))
71+
expect_equal(unlist(color_scheme_get()), RColorBrewer::brewer.pal(6, "Blues"), ignore_attr = TRUE)
7672
color_scheme_set("brewer-Spectral")
77-
expect_equivalent(unlist(color_scheme_get()), RColorBrewer::brewer.pal(6, "Spectral"))
73+
expect_equal(unlist(color_scheme_get()), RColorBrewer::brewer.pal(6, "Spectral"), ignore_attr = TRUE)
7874
expect_error(color_scheme_set("brewer-FAKE"), "FAKE is not a valid palette")
7975
})
8076

@@ -106,11 +102,11 @@ test_that("mixed_scheme internal function doesn't error", {
106102
test_that("custom color schemes work", {
107103
color_scheme_set(orange_scheme_ok)
108104
expect_named(color_scheme_get())
109-
expect_equivalent(unlist(color_scheme_get()), orange_scheme_ok)
105+
expect_equal(unlist(color_scheme_get()), orange_scheme_ok, ignore_attr = TRUE)
110106

111107
random_scheme <- colors()[sample(length(colors()), 6)]
112108
color_scheme_set(random_scheme)
113-
expect_equivalent(unlist(color_scheme_get()), random_scheme)
109+
expect_equal(unlist(color_scheme_get()), random_scheme, ignore_attr = TRUE)
114110
})
115111

116112
test_that("get_color returns correct color values", {

tests/testthat/test-available_ppc.R

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
library(bayesplot)
2-
context("available_mcmc and available_ppc")
3-
4-
51
test_that("available_mcmc works", {
62
a <- available_mcmc()
73
expect_s3_class(a, "bayesplot_function_list")

tests/testthat/test-bayesplot_grid.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
library(bayesplot)
2-
context("bayesplot_grid")
3-
41
skip_if_not_installed("gridExtra")
52

63
y <- example_y_data()

tests/testthat/test-convenience-functions.R

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,39 @@
1-
library(bayesplot)
21
library(ggplot2)
3-
context("Convenience functions (for ggplot objects)")
4-
52

63
# abline_01, vline_ and hline_ ------------------------------------------
74
test_that("abline_01 returns the correct object", {
85
a <- abline_01(color = "green", linetype = 2)
96
b <- geom_abline(intercept = 0, slope = 1, color = "green", linetype = 2, na.rm = TRUE)
107
a$constructor <- b$constructor <- NULL
11-
expect_equal(a, b, check.environment = FALSE)
8+
expect_equal(a, b, ignore_function_env = TRUE)
129
})
1310
test_that("vline_* and hline_* return correct objects", {
1411
a <- vline_0(color = "red")
1512
b <- geom_vline(xintercept = 0, color = "red", na.rm = TRUE)
1613
a$constructor <- b$constructor <- NULL
17-
expect_equal(a, b, check.environment = FALSE)
14+
expect_equal(a, b, ignore_function_env = TRUE)
1815

1916
a <- hline_0(linewidth = 2, linetype = 3)
2017
b <- geom_hline(yintercept = 0, linewidth = 2, linetype = 3, na.rm = TRUE)
2118
a$constructor <- b$constructor <- NULL
22-
expect_equal(a, b, check.environment = FALSE)
19+
expect_equal(a, b, ignore_function_env = TRUE)
2320

2421
a <- vline_at(c(3,4), na.rm = FALSE)
2522
b <- geom_vline(xintercept = c(3,4))
2623
a$constructor <- b$constructor <- NULL
27-
expect_equal(a, b, check.environment = FALSE)
24+
expect_equal(a, b, ignore_function_env = TRUE)
2825

2926
a <- hline_at(c(3,4), na.rm = FALSE)
3027
b <- geom_hline(yintercept = c(3,4))
3128
a$constructor <- b$constructor <- NULL
32-
expect_equal(a, b, check.environment = FALSE)
29+
expect_equal(a, b, ignore_function_env = TRUE)
3330
})
3431
test_that("vline_at with 'fun' works", {
3532
x <- example_mcmc_draws(chains = 1)
3633
a <- vline_at(x, colMeans)
3734
b <- geom_vline(xintercept = colMeans(x), na.rm = TRUE)
3835
a$constructor <- b$constructor <- NULL
39-
expect_equal(a, b, check.environment = FALSE)
36+
expect_equal(a, b, ignore_function_env = TRUE)
4037
})
4138
test_that("calc_v (internal function) works", {
4239
a <- 1:4
@@ -99,20 +96,21 @@ test_that("facet_bg returns correct theme object", {
9996
test_that("legend_none returns correct theme object", {
10097
none <- legend_none()
10198
expect_s3_class(none, "theme")
102-
expect_equivalent(none, list(legend.position = "none"))
99+
expect_equal(none$legend.position, "none", ignore_attr = TRUE)
103100
expect_false(attr(none, "complete"))
104101
})
105102
test_that("legend_move returns correct theme object", {
106103
left <- legend_move("left")
107104
expect_s3_class(left, "theme")
108-
expect_equivalent(left, list(legend.position = "left"))
105+
expect_equal(left$legend.position, "left", ignore_attr = TRUE)
109106
expect_false(attr(left, "complete"))
110107

111108
pos <- legend_move(c(0.25, 0.5))
112109
expect_s3_class(pos, "theme")
113-
expect_equivalent(
110+
expect_equal(
114111
pos$legend.position.inside %||% pos$legend.position,
115-
c(0.25, 0.5)
112+
c(0.25, 0.5),
113+
ignore_attr = TRUE
116114
)
117115
expect_false(attr(pos, "complete"))
118116
})
@@ -133,9 +131,10 @@ test_that("xaxis_text returns correct theme object", {
133131
})
134132
test_that("yaxis_text returns correct theme object", {
135133
expect_identical(yaxis_text(FALSE), theme(axis.text.y = element_blank()))
136-
expect_equivalent(
134+
expect_equal(
137135
yaxis_text(face = "bold", angle = 30),
138-
theme(axis.text.y = element_text(face = "bold", angle = 30))
136+
theme(axis.text.y = element_text(face = "bold", angle = 30)),
137+
ignore_attr = TRUE
139138
)
140139
})
141140
test_that("facet_text returns correct theme object", {
@@ -185,7 +184,7 @@ test_that("overlay_function returns the correct object", {
185184
a <- overlay_function(fun = "dnorm")
186185
b <- stat_function(fun = "dnorm", inherit.aes = FALSE)
187186
a$constructor <- b$constructor <- NULL
188-
expect_equal(a, b, check.environment = FALSE)
187+
expect_equal(a, b, ignore_function_env = TRUE)
189188
})
190189

191190

0 commit comments

Comments
 (0)