Skip to content

Commit

Permalink
lints
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Dec 4, 2023
1 parent a1c655c commit b8b56e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
@@ -1,6 +1,6 @@
# tarchetypes 0.7.10

* Prepare to use `tar_seed_create()` (https://github.com/ropensci/targets/issues/1139).
* Prepare to use `tar_seed_create()` and `tar_seed_set()` (https://github.com/ropensci/targets/issues/1139). Future versions of `tarchetypes` should use these package functions, but this version cannot because of the compatibility constraints of the release cycle.
* Migrate tests to `targets` >= 1.3.2.9004 progress statuses ("completed" instead of "built", "dispatched" instead of "started").

# tarchetypes 0.7.9
Expand Down
8 changes: 4 additions & 4 deletions R/utils_seed.R
@@ -1,5 +1,5 @@
# TODO: use targets::tar_seed_create() when CRAN targets has it.
tar_seed_create <- function (name, global_seed = NULL) {
tar_seed_create <- function(name, global_seed = NULL) {
if (is.null(global_seed)) {
global_seed <- targets::tar_option_get("seed")
}
Expand All @@ -10,20 +10,20 @@ tar_seed_create <- function (name, global_seed = NULL) {
hash <- digest::digest(
object = name,
algo = "sha512",
serialize = FALSE,
serialize = FALSE,
file = FALSE,
seed = 0L
)
digest::digest2int(x = hash, seed = global_seed)
}

# TODO: same
tar_seed_set <- function (seed) {
tar_seed_set <- function(seed) {
if (!is.null(seed) && !anyNA(seed)) {
set.seed(
seed = seed,
kind = "default",
normal.kind = "default",
normal.kind = "default",
sample.kind = "default"
)
}
Expand Down

0 comments on commit b8b56e8

Please sign in to comment.