Skip to content

Commit

Permalink
Release/0.3.0 cran update (#449)
Browse files Browse the repository at this point in the history
* Update examples to `dontrun` for CRAN

* Update documentation

* reformat NEWS.md and update wordlist

* Add .onLoad to ensure that CRAN checks don't yuse more than 2 CPUs
  • Loading branch information
AlexAxthelm authored Jan 8, 2024
1 parent a068675 commit 1c040b6
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 4 deletions.
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# r2dii.analysis 0.3.0

# `target_sda` now uses final year of scenario as convergence target when `by_company = TRUE` (#445).
# `target_market_share` gains argument `increasing_or_decreasing` (#426).
* `target_sda` now uses final year of scenario as convergence target when `by_company = TRUE` (#445).
* `target_market_share` gains argument `increasing_or_decreasing` (#426).

# r2dii.analysis 0.2.1

Expand Down
2 changes: 2 additions & 0 deletions R/join_ald_scenario.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#' @export
#'
#' @examples
#' \dontrun{
#' installed <- requireNamespace("r2dii.data", quietly = TRUE) &&
#' requireNamespace("r2dii.match", quietly = TRUE) &&
#' packageVersion("r2dii.match") >= "0.1.0"
Expand Down Expand Up @@ -38,6 +39,7 @@
#' region_isos = region_isos_demo
#' )
#' }
#' }
join_ald_scenario <- function(data,
ald,
scenario,
Expand Down
9 changes: 9 additions & 0 deletions R/r2dii.analysis-package.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#' @keywords internal
"_PACKAGE"

.onLoad <- function(libname, pkgname) {
# CRAN OMP THREAD LIMIT
# logic for setting OMP_THREAD_LIMIT form https://stackoverflow.com/a/77323812
# check modified from testthat's on_cran function
if (!interactive() && isFALSE(as.logical(Sys.getenv("NOT_CRAN", "false")))) {
Sys.setenv("OMP_THREAD_LIMIT" = 2)
}
}

# The following block is used by usethis to automatically manage
# roxygen namespace tags. Modify with care!
## usethis namespace: start
Expand Down
2 changes: 2 additions & 0 deletions R/summarize_weighted_production.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#' `summarize_weighted_percent_change()`, respectively.
#'
#' @examples
#' \dontrun{
#' installed <- requireNamespace("r2dii.data", quietly = TRUE) &&
#' requireNamespace("r2dii.match", quietly = TRUE) &&
#' packageVersion("r2dii.match") >= "0.1.0"
Expand Down Expand Up @@ -55,6 +56,7 @@
#'
#' summarize_weighted_percent_change(master, use_credit_limit = TRUE)
#' }
#' }
summarize_weighted_production <- function(data, ..., use_credit_limit = FALSE) {
summarize_weighted_production_(data, ..., use_credit_limit = use_credit_limit, with_targets = FALSE)
}
Expand Down
2 changes: 2 additions & 0 deletions R/target_market_share.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#' @family functions to calculate scenario targets
#'
#' @examples
#' \dontrun{
#' installed <- requireNamespace("r2dii.data", quietly = TRUE) &&
#' requireNamespace("r2dii.match", quietly = TRUE) &&
#' packageVersion("r2dii.match") >= "0.1.0"
Expand Down Expand Up @@ -74,6 +75,7 @@
#' weight_production = FALSE
#' )
#' }
#' }
target_market_share <- function(data,
abcd,
scenario,
Expand Down
3 changes: 2 additions & 1 deletion R/target_sda.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#' @family functions to calculate scenario targets
#'
#' @examples
#' \dontrun{
#' installed <- requireNamespace("r2dii.match", quietly = TRUE) &&
#' requireNamespace("r2dii.data", quietly = TRUE) &&
#' packageVersion("r2dii.match") >= "0.1.0"
Expand Down Expand Up @@ -65,7 +66,7 @@
#' by_company = TRUE
#' )
#' }
#'
#' }
target_sda <- function(data,
abcd,
co2_intensity_scenario,
Expand Down
4 changes: 4 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Codecov
Decarbonization
IKI
Lifecycle
Metaprogramming
ORCID
PACTA
PACTA’
Expand All @@ -14,13 +15,15 @@ SDA
Sectoral
WRI
WWF
abcd
ald
decarbonization
dev
dfrac
dii
dplyr
eval
favour
frac
funder
funders
Expand All @@ -34,6 +37,7 @@ roadmaps
rstudio
sectoral
smsp
summarise
tibble
tidyverse
tmsr
Expand Down
2 changes: 2 additions & 0 deletions man/join_ald_scenario.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/summarize_weighted_production.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/target_market_share.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/target_sda.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1c040b6

Please sign in to comment.