Skip to content

Commit 1092a05

Browse files
authored
Merge pull request #746 from njtierney/master
tweaks for CRAN 0.5.0 release
2 parents 7ec5b0a + efab18a commit 1092a05

File tree

3 files changed

+67
-44
lines changed

3 files changed

+67
-44
lines changed

inst/WORDLIST

+15-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ AVX
33
AdagradDAOptimiser
44
CMD
55
CRAN's
6+
Cmd
67
Codecov
8+
Ctrl
79
DAGs
810
DiagrammeR
911
GPUs
@@ -18,6 +20,7 @@ Hermann
1820
Hessians
1921
JIT
2022
Jupyter
23+
LKJ
2124
Lmax
2225
Lmin
2326
McMahan
@@ -45,16 +48,20 @@ acyclic
4548
al
4649
analysed
4750
args
51+
automagically
4852
bayesplot
4953
behaviour
54+
bijection
5055
broadcastable
5156
broadcasted
57+
chol
58+
choleskied
5259
cholesky
5360
cli
5461
colour
5562
colours
5663
conda
57-
cran
64+
dependences
5865
deps
5966
devtools
6067
dlkjcorr
@@ -66,6 +73,7 @@ equalling
6673
et
6774
extraDistr
6875
generalises
76+
geweke
6977
gfortran
7078
github
7179
greta's
@@ -80,7 +88,9 @@ joss
8088
labelled
8189
libxml
8290
linux
91+
lkj
8392
logfile
93+
logfiles
8494
maximise
8595
mcmc
8696
md
@@ -90,6 +100,7 @@ modelled
90100
modelling
91101
multisession
92102
nd
103+
normalisation
93104
normalised
94105
optimisation
95106
optimisations
@@ -123,8 +134,10 @@ softmax
123134
specialised
124135
summarise
125136
tensorflow
137+
tensorflows
126138
tf
127139
tfp
140+
tril
128141
tuh
129142
unadjusted
130143
uncentered
@@ -133,4 +146,5 @@ vectorising
133146
visualise
134147
warmup
135148
winbuilder
149+
wishart
136150
zhang

tests/testthat/_snaps/print_calculate.md

+45-37
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,48 @@
77
, , 1
88
99
[,1]
10-
[1,] 0.4559286
11-
[2,] -0.9169700
12-
[3,] 0.2051770
13-
[4,] -1.7940580
14-
[5,] 1.2063919
15-
[6,] -0.1103080
16-
[7,] 0.5195801
17-
[8,] -0.7110114
18-
[9,] 1.0908014
19-
[10,] -1.0610485
10+
[1,] -1.3716505
11+
[2,] -0.3086943
12+
[3,] -1.2029317
13+
[4,] -0.7109460
14+
[5,] -0.4889447
15+
[6,] 1.1541374
16+
[7,] 0.8869046
17+
[8,] -0.3983025
18+
[9,] 0.4208952
19+
[10,] -1.1759923
2020
2121
2222

2323
---
2424

2525
Code
26-
x_draws_10
27-
Output
28-
$x
29-
, , 1
30-
31-
[,1]
32-
[1,] -0.64461997
33-
[2,] -1.89567086
34-
[3,] -1.32104850
35-
[4,] 0.07416449
36-
[5,] -1.33409029
37-
[6,] -1.88981759
38-
[7,] -0.32234742
39-
[8,] 0.42244656
40-
[9,] -0.11780999
41-
[10,] -1.11090368
26+
x_draws_values
27+
Message
4228
29+
-- MCMC draws from greta -------------------------------------------------------
30+
* Iterations = 10
31+
* Chains = 4
32+
* Thinning = 1
4333
34+
-- Chain 1 (iterations 1...5) --------------------------------------------------
35+
Output
36+
x
37+
[1,] -0.08002652
38+
[2,] -1.83388724
39+
[3,] -0.16133841
40+
[4,] -0.01941975
41+
[5,] -0.43649773
42+
Message
43+
i 5 more draws
44+
Use `print(n = ...)` to see more draws
45+
--------------------------------------------------------------------------------
46+
i View greta draw chain i with:
47+
`greta_draws_object[[i]]`.
48+
E.g., view chain 1 with:
49+
`greta_draws_object[[1]]`.
50+
i To see a summary of draws, run:
51+
`summary(greta_draws_object)`
4452

4553
---
4654

@@ -50,17 +58,17 @@
5058
$x
5159
, , 1
5260
53-
[,1]
54-
[1,] -0.64461997
55-
[2,] -1.89567086
56-
[3,] -1.32104850
57-
[4,] 0.07416449
58-
[5,] -1.33409029
59-
[6,] -1.88981759
60-
[7,] -0.32234742
61-
[8,] 0.42244656
62-
[9,] -0.11780999
63-
[10,] -1.11090368
61+
[,1]
62+
[1,] 0.1224691
63+
[2,] 1.6876720
64+
[3,] -2.0192331
65+
[4,] -1.2172102
66+
[5,] 0.8676729
67+
[6,] -0.1613384
68+
[7,] -1.0970895
69+
[8,] -2.0362168
70+
[9,] 0.9766937
71+
[10,] 0.9396561
6472
6573
6674

tests/testthat/test-print_calculate.R

+7-6
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ test_that("calculate print method is different for different inputs", {
66

77
x <- normal(0,1)
88
m <- model(x)
9-
tensorflow::set_random_seed(2024-07-30-1057)
10-
draws <- mcmc(m, n_samples = 10, warmup = 10, verbose = FALSE)
11-
x_sim_10 <- calculate(x, nsim = 10, seed = 2024-08-1004)
12-
x_draws_10 <- calculate(x, values = draws, seed = 2024-08-1004)
13-
x_draws_10 <- calculate(x, values = draws, nsim = 10, seed = 2024-08-1004)
9+
new_seed <- 2024-11-07-14-01
10+
x_sim_10 <- calculate(x, nsim = 10, seed = new_seed)
1411
expect_snapshot(x_sim_10)
15-
expect_snapshot(x_draws_10)
12+
set.seed(new_seed)
13+
draws <- mcmc(m, n_samples = 10, warmup = 10, verbose = FALSE)
14+
x_draws_values <- calculate(x, values = draws, seed = new_seed)
15+
expect_snapshot(x_draws_values)
16+
x_draws_10 <- calculate(x, values = draws, nsim = 10, seed = new_seed)
1617
expect_snapshot(x_draws_10)
1718
})

0 commit comments

Comments
 (0)