Skip to content

Commit

Permalink
Merge branch 'develop' into siteID-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Sweetdevil144 authored Sep 3, 2024
2 parents 9edc268 + 72e67a9 commit a7c4b7d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions modules/assim.sequential/R/downscale_function.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ SDA_downscale_preprocess <- function(data_path, coords_path, date, carbon_pool)
return(list(input_data = input_data, site_coordinates = site_coordinates, carbon_data = carbon_data))
}

##' @noRd
##'
##' @title Create folds function
##' @name .create_folds
##' @author Sambhav Dixit
Expand Down
13 changes: 10 additions & 3 deletions scripts/confirm_deps.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,23 @@ confirm_deps <- function(pkg,
install = TRUE,
dependencies = NA,
...) {

# Q: "Why a separate variable instead of overwriting `dependencies`?"
# A: As a quick workaround for https://github.com/r-lib/remotes/issues/809:
# remotes::install_deps(pkgdir, `dependencies = TRUE`) correctly installs
# optional deps of `pkgdir` but only hard deps of its dependencies,
# whereas `dependencies = c(..., "Suggests")` installs the whole
# recursive chain of Suggests of Suggests of Suggests.
if (all(is.na(dependencies)) || all(dependencies == "hard")) {
dependencies <- c("Depends", "Imports", "LinkingTo")
dependency_types <- c("Depends", "Imports", "LinkingTo")
} else if (isTRUE(dependencies) || all(dependencies == "soft")) {
dependencies <- c("Depends", "Imports", "LinkingTo", "Suggests")
dependency_types <- c("Depends", "Imports", "LinkingTo", "Suggests")
} else if (isFALSE(dependencies)) {
return() # for compatibility with remotes::install_deps
}

deps <- desc::desc_get_deps(pkg)
deps <- deps[deps$type %in% dependencies, ]
deps <- deps[deps$type %in% dependency_types, ]

pkgs <- as.data.frame(installed.packages(), stringsAsFactors = FALSE)[, c("Package", "Version")]
colnames(pkgs) <- c("package", "installed_version")
Expand Down

0 comments on commit a7c4b7d

Please sign in to comment.