From cf7ef28c1284ad006eb9b1f6c18e54e8a66271a4 Mon Sep 17 00:00:00 2001 From: nikosbosse Date: Wed, 29 Nov 2023 09:56:22 +0100 Subject: [PATCH] fix Note on CRAN about too many threads used by scoringutils --- .Rbuildignore | 1 + R/summarise_scores.R | 1 + man/add_coverage.Rd | 1 + tests/testthat/setup.R | 3 ++- vignettes/scoringutils.Rmd | 1 + 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.Rbuildignore b/.Rbuildignore index 6cc6c4991..ebdc8b742 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -17,3 +17,4 @@ ^\.devcontainer$ ^CODE_OF_CONDUCT\.md$ ^inst/manuscript/output$ +^CRAN-SUBMISSION$ diff --git a/R/summarise_scores.R b/R/summarise_scores.R index 5283a8061..615c41e28 100644 --- a/R/summarise_scores.R +++ b/R/summarise_scores.R @@ -279,6 +279,7 @@ check_summary_params <- function(scores, #' summary is present according to the value specified in `by`. #' @examples #' library(magrittr) # pipe operator +#' data.table::setDTthreads(1) # only needed to avoid issues on CRAN #' score(example_quantile) %>% #' add_coverage(by = c("model", "target_type")) %>% #' summarise_scores(by = c("model", "target_type")) %>% diff --git a/man/add_coverage.Rd b/man/add_coverage.Rd index ad658432e..45ac422e3 100644 --- a/man/add_coverage.Rd +++ b/man/add_coverage.Rd @@ -33,6 +33,7 @@ the unit of a single forecast. } \examples{ library(magrittr) # pipe operator +data.table::setDTthreads(1) # only needed to avoid issues on CRAN score(example_quantile) \%>\% add_coverage(by = c("model", "target_type")) \%>\% summarise_scores(by = c("model", "target_type")) \%>\% diff --git a/tests/testthat/setup.R b/tests/testthat/setup.R index 5f2b22a2c..37aff0af0 100644 --- a/tests/testthat/setup.R +++ b/tests/testthat/setup.R @@ -1,6 +1,7 @@ # load common required test packages library(ggplot2, quietly = TRUE) suppressMessages(library(magrittr)) +data.table::setDTthreads(1) # only needed to avoid issues on CRAN # compute quantile scores -scores <- suppressMessages(score(example_quantile)) \ No newline at end of file +scores <- suppressMessages(score(example_quantile)) diff --git a/vignettes/scoringutils.Rmd b/vignettes/scoringutils.Rmd index 72d1f159f..10061aed2 100644 --- a/vignettes/scoringutils.Rmd +++ b/vignettes/scoringutils.Rmd @@ -19,6 +19,7 @@ library(magrittr) library(data.table) library(ggplot2) library(knitr) +data.table::setDTthreads(1) # only needed to avoid issues on CRAN ``` The `scoringutils` package provides a collection of metrics and proper scoring rules that make it simple to score probabilistic forecasts against the true observed values. You can find more information in the paper [Evaluating Forecasts with scoringutils in R](https://arxiv.org/abs/2205.07090) as well as the [Metrics-Vignette](https://epiforecasts.io/scoringutils/articles/metric-details.html) and the [Scoring forecasts directly Vignette](https://epiforecasts.io/scoringutils/articles/scoring-forecasts-directly.html).