Skip to content

Commit

Permalink
Merge branch 'master' into feature/marginalise
Browse files Browse the repository at this point in the history
  • Loading branch information
goldingn committed Feb 18, 2020
2 parents faa9cad + 18c581c commit f0c68a2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
9 changes: 7 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -1159,8 +1159,13 @@ all_greta_arrays <- function(env = parent.frame(),

# all objects in that environment as a named list
all_object_names <- ls(envir = env)
all_objects <- lapply(all_object_names, get, envir = env)
names(all_objects) <- all_object_names

# loop carefully in case there are unfulfilled promises
all_objects <- list()
for (name in all_object_names) {
all_objects[[name]] <- tryCatch(get(name, envir = env),
error = function(e) NULL)
}

# find the greta arrays
is_greta_array <- vapply(all_objects,
Expand Down
2 changes: 2 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ CRAN's
dag
DAGs
devtools
diag
DiagrammeR
dlkjcorr
doi
dontrun
etc
extraDistr
Gelman
gelman
Geweke
gfortran
github
Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test_iid_samples.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ test_that("univariate samples are correct", {

compare_iid_samples(binomial,
rbinom,
parameters = list(size = 12, prob = 0.3))
parameters = list(size = 5, prob = 0.3),
nsim = 1000)

compare_iid_samples(beta_binomial,
extraDistr::rbbinom,
Expand Down

1 comment on commit f0c68a2

@lintr-bot
Copy link

Choose a reason for hiding this comment

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

R/dag_class.R:6:1: style: functions should have cyclomatic complexity of less than 50, this has 51.

dag_class <- R6Class(
^

R/marginalise.R:172:1: style: Lines should not be more than 80 characters.

# x will be the target; a tf constructor function for the distribution being
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Please sign in to comment.