Skip to content

Commit

Permalink
To align with ropensci/targets#1244 and ropensci/targets#1262, switch…
Browse files Browse the repository at this point in the history
… the hashing functions from digest::digest() to secretbase::siphash13().
  • Loading branch information
wlandau-lilly committed Apr 5, 2024
1 parent 6c1e96d commit 07ac340
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 81 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Description: Bayesian data analysis usually incurs long runtimes
For the underlying methodology, please refer
to the documentation of 'targets' <doi:10.21105/joss.02959> and 'JAGS'
(Plummer 2003) <https://www.r-project.org/conferences/DSC-2003/Proceedings/Plummer.pdf>.
Version: 1.1.0.9001
Version: 1.1.0.9002
License: MIT + file LICENSE
URL: https://docs.ropensci.org/jagstargets/, https://github.com/ropensci/jagstargets
BugReports: https://github.com/ropensci/jagstargets/issues
Expand All @@ -39,17 +39,17 @@ Depends:
R (>= 3.5.0)
Imports:
coda (>= 0.19.4),
digest (>= 0.6.25),
fst (>= 0.9.2),
posterior (>= 1.0.1),
purrr (>= 0.3.4),
qs (>= 0.23.2),
R2jags (>= 0.6.1),
rjags (>= 4.10),
rlang (>= 0.4.10),
secretbase (>= 0.4.0),
stats,
targets (>= 1.5.1.9001),
tarchetypes (>= 0.7.12.9001),
targets (>= 1.6.0),
tarchetypes (>= 0.8.0),
tibble (>= 3.0.1),
tidyselect,
tools,
Expand Down
4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ export(tar_jags_rep_summary)
export(tar_jags_run)
importFrom(coda,mcmc)
importFrom(coda,mcmc.list)
importFrom(digest,digest)
importFrom(digest,digest2int)
importFrom(fst,read_fst)
importFrom(posterior,summarize_draws)
importFrom(purrr,map)
Expand All @@ -22,6 +20,7 @@ importFrom(purrr,map_dfr)
importFrom(qs,qread)
importFrom(rlang,expr)
importFrom(rlang,quo_squash)
importFrom(secretbase,siphash13)
importFrom(stats,rnorm)
importFrom(stats,runif)
importFrom(tarchetypes,tar_combine)
Expand All @@ -46,6 +45,7 @@ importFrom(targets,tar_option_get)
importFrom(targets,tar_option_set)
importFrom(targets,tar_read)
importFrom(targets,tar_script)
importFrom(targets,tar_seed_create)
importFrom(targets,tar_target)
importFrom(targets,tar_target_raw)
importFrom(targets,tar_test)
Expand Down
8 changes: 7 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# jagstargets 1.1.0.9001 (development)
# jagstargets 1.1.0.9002 (development)

## Invalidating changes

* To align with https://github.com/ropensci/targets/issues/1244 and https://github.com/ropensci/targets/pull/1262, switch the hashing functions from `digest::digest()` to `secretbase::siphash13()`.

## Other changes

* Add the new `description` arguments of `tar_target()` (`targets >= 1.5.1.9001).
* Append model file information to the target descriptions using `tar_map()` (`tarchetypes` >= 0.7.12.9001).
Expand Down
4 changes: 2 additions & 2 deletions R/tar_jags_package.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
#' @seealso <https://docs.ropensci.org/jagstargets/>, [tar_jags()]
#' @aliases jagstargets
#' @importFrom coda mcmc mcmc.list
#' @importFrom digest digest digest2int
#' @importFrom fst read_fst
#' @importFrom posterior summarize_draws
#' @importFrom purrr map map_dbl map_dfr
#' @importFrom qs qread
#' @importFrom rlang expr quo_squash
#' @importFrom secretbase siphash13
#' @importFrom stats rnorm runif
#' @importFrom targets tar_assert_chr tar_assert_in
#' tar_assert_nonempty tar_assert_not_dir
#' tar_assert_not_in tar_assert_nzchar
#' tar_assert_path tar_assert_scalar tar_assert_unique
#' tar_definition tar_deparse_language tar_deparse_safe
#' tar_cue tar_dir tar_load tar_name tar_option_get tar_option_set
#' tar_read tar_script tar_target tar_target_raw tar_test
#' tar_read tar_script tar_seed_create tar_target tar_target_raw tar_test
#' tar_throw_validate tar_tidy_eval tar_warn_deprecate
#' @importFrom tarchetypes tar_combine tar_map
#' @importFrom tibble as_tibble tibble
Expand Down
2 changes: 1 addition & 1 deletion R/tar_jags_rep.R
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ tar_jags_rep_run_rep <- function(
summary_args = summary_args,
transform = transform
)
out$.rep <- digest::digest(runif(1), algo = "xxhash32")
out$.rep <- secretbase::siphash13(runif(1))
out$.seed <- seed
out
}
2 changes: 1 addition & 1 deletion R/utils_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ produce_seed_rep <- function(name, batch, rep, reps) {
return(NA_integer_)
}
scalar <- paste(name, rep + reps * (batch - 1))
digest::digest2int(as.character(scalar), seed = seed)
targets::tar_seed_create(as.character(scalar), global_seed = seed)
}
Loading

0 comments on commit 07ac340

Please sign in to comment.