Skip to content

Commit

Permalink
Revert "number of data.table cores for some examples and vignettes"
Browse files Browse the repository at this point in the history
This reverts commit 383fc70.
  • Loading branch information
santikka committed Aug 23, 2023
1 parent 2808eb8 commit b5c0c67
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 16 deletions.
1 change: 0 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

* `get_data` method for `dynamitefit` object now correctly uses the previously defined priors instead of the default ones.
* Fixed a bug in indexing of random effect terms.
* Limited the number of parallel threads used by the `data.table` package in some examples for CRAN.

# dynamite 1.4.4

Expand Down
3 changes: 0 additions & 3 deletions R/as_draws.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
#' @inheritParams as.data.frame.dynamitefit
#' @return A `draws_df` object.
#' @examples
#' threads <- data.table::getDTthreads()
#' data.table::setDTthreads(threads = 1) # For CRAN
#' as_draws(gaussian_example_fit, types = c("sigma", "beta"))
#' data.table::setDTthreads(threads = threads) # Restore
#'
#' # Compute MCMC diagnostics using the posterior package
#' posterior::summarise_draws(as_draws(gaussian_example_fit))
Expand Down
3 changes: 0 additions & 3 deletions R/dynamite.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@
#' # Please update your rstan and StanHeaders installation before running
#' # on Windows
#' if (!identical(.Platform$OS.type, "windows")) {
#' threads <- data.table::getDTthreads()
#' data.table::setDTthreads(threads = 1) # For CRAN
#' fit <- dynamite(
#' dformula = obs(y ~ -1 + varying(~x), family = "gaussian") +
#' lags(type = "varying") +
Expand All @@ -147,7 +145,6 @@
#' chains = 1,
#' refresh = 0
#' )
#' data.table::setDTthreads(threads = threads) # Restore
#' }
#' }
#'
Expand Down
3 changes: 0 additions & 3 deletions R/mcmc_diagnostics.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
#' positive (unrestricted) integer.
#' @return Returns `x` (invisibly).
#' @examples
#' threads <- data.table::getDTthreads()
#' data.table::setDTthreads(threads = 1) # For CRAN
#' mcmc_diagnostics(gaussian_example_fit)
#' data.table::setDTthreads(threads = threads) # Restore
#'
mcmc_diagnostics <- function(x, n) {
UseMethod("mcmc_diagnostics", x)
Expand Down
3 changes: 0 additions & 3 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,8 @@ plot.dynamitefit <- function(x, parameters = NULL, type = NULL,
#' @srrstats {G2.3a} Uses match.arg.
#' @srrstats {BS6.1, RE6.0, RE6.1, BS6.3} Implements the `plot` method.
#' @examples
#' threads <- data.table::getDTthreads()
#' data.table::setDTthreads(threads = 1) # For CRAN
#' plot_deltas(gaussian_example_fit, level = 0.025, scales = "free") +
#' ggplot2::theme_minimal()
#' data.table::setDTthreads(threads = threads) # Restore
#'
plot_deltas <- function(x, parameters = NULL, responses = NULL, level = 0.05,
alpha = 0.5, scales = c("fixed", "free"),
Expand Down
1 change: 0 additions & 1 deletion vignettes/dynamite.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ options(dplyr.summarise.inform = FALSE)
options(crayon.enabled = FALSE)
options(dplyr.summarise.inform = FALSE)
set.seed(0)
data.table::setDTthreads(threads = 1)
```

This vignette is a modification of [@dynamite] which contains more examples and details.
Expand Down
1 change: 0 additions & 1 deletion vignettes/dynamite_priors.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ options(dplyr.summarise.inform = FALSE)
options(crayon.enabled = FALSE)
options(dplyr.summarise.inform = FALSE)
set.seed(0)
data.table::setDTthreads(threads = 1)
```

# Default prior distributions in dynamite
Expand Down
1 change: 0 additions & 1 deletion vignettes/dynamite_simulation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ knitr::opts_chunk$set(
)
library("dynamite")
suppressPackageStartupMessages(library("ggplot2"))
data.table::setDTthreads(threads = 1)
```

# Using dynamite to generate panel data
Expand Down

0 comments on commit b5c0c67

Please sign in to comment.