-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a906886
commit 2a5ca1f
Showing
20 changed files
with
110 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# targets 1.2.2.9003 (development) | ||
# targets 1.2.2.9004 (development) | ||
|
||
## Invalidating changes | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Borrowed from https://github.com/r-lib/withr/blob/main/R/seed.R | ||
# under the MIT license. See the NOTICE file in the targets package source. | ||
#' @title Resore random number generator state | ||
#' @export | ||
#' @keywords internal | ||
#' @description Not a user-side function. | ||
#' @return `NULL` (invisibly). Called for its side effects. | ||
#' @param old_seed Old seed. | ||
#' @param old_algorithm Old RNG algorithm. | ||
tar_restore_random <- function(old_seed, old_algorithm) { | ||
RNGkind(kind = old_algorithm) | ||
if_any( | ||
is.null(old_seed), { | ||
set.seed(seed = NULL) | ||
rm(list = ".Random.seed", envir = .GlobalEnv) | ||
}, | ||
assign(x = ".Random.seed", value = old_seed, envir = .GlobalEnv) | ||
) | ||
} | ||
|
||
produce_seed <- function() { | ||
seed_pipeline <- .subset2(tar_options, "get_seed")() | ||
if (anyNA(seed_pipeline)) { | ||
return(NA_integer_) | ||
} | ||
seed_runtime <- .subset2(tar_runtime, "seed") | ||
algorithm <- .subset(RNGkind(), 1L) | ||
if (is.null(seed_runtime)) { | ||
set.seed(seed = seed_pipeline, kind = "L'Ecuyer-CMRG") | ||
} else if (algorithm != "L'Ecuyer-CMRG") { | ||
RNGkind(kind = "L'Ecuyer-CMRG") | ||
.GlobalEnv[[".Random.seed"]] <- seed_runtime | ||
} | ||
seed_next <- parallel::nextRNGStream(seed = seed_runtime) | ||
tar_runtime$seed <- seed_next | ||
seed_next | ||
} |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.