From 07ac3408b329d967ec610a7f27c5d8ba60e4eab4 Mon Sep 17 00:00:00 2001 From: wlandau-lilly Date: Fri, 5 Apr 2024 14:50:38 -0400 Subject: [PATCH] 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(). --- DESCRIPTION | 8 +-- NAMESPACE | 4 +- NEWS.md | 8 ++- R/tar_jags_package.R | 4 +- R/tar_jags_rep.R | 2 +- R/utils_data.R | 2 +- codemeta.json | 166 +++++++++++++++++++++++++------------------ 7 files changed, 113 insertions(+), 81 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4dc6d0e..a829ff0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -13,7 +13,7 @@ Description: Bayesian data analysis usually incurs long runtimes For the underlying methodology, please refer to the documentation of 'targets' and 'JAGS' (Plummer 2003) . -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 @@ -39,7 +39,6 @@ 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), @@ -47,9 +46,10 @@ Imports: 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, diff --git a/NAMESPACE b/NAMESPACE index 917e2ea..0bdafe0 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -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) @@ -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) @@ -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) diff --git a/NEWS.md b/NEWS.md index 15521d0..b467bd7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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). diff --git a/R/tar_jags_package.R b/R/tar_jags_package.R index a0eb51c..58e36d1 100644 --- a/R/tar_jags_package.R +++ b/R/tar_jags_package.R @@ -12,12 +12,12 @@ #' @seealso , [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 @@ -25,7 +25,7 @@ #' 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 diff --git a/R/tar_jags_rep.R b/R/tar_jags_rep.R index 78de837..e768c0d 100644 --- a/R/tar_jags_rep.R +++ b/R/tar_jags_rep.R @@ -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 } diff --git a/R/utils_data.R b/R/utils_data.R index b657492..873eb63 100644 --- a/R/utils_data.R +++ b/R/utils_data.R @@ -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) } diff --git a/codemeta.json b/codemeta.json index b4daf3d..78af58c 100644 --- a/codemeta.json +++ b/codemeta.json @@ -1,48 +1,47 @@ { - "@context": [ - "https://doi.org/10.5063/schema/codemeta-2.0", - "http://schema.org" - ], + "@context": "https://doi.org/10.5063/schema/codemeta-2.0", "@type": "SoftwareSourceCode", "identifier": "jagstargets", - "description": "Bayesian data analysis usually incurs long runtimes\n and cumbersome custom code.\n A pipeline toolkit tailored to Bayesian statisticians,\n the 'jagstargets' R package is leverages\n 'targets' and 'R2jags' to ease this burden.\n 'jagstargets' makes it super easy to set up scalable\n JAGS pipelines that automatically parallelize the computation\n and skip expensive steps when the results are already up to date.\n Minimal custom code is required, and there is no need to manually\n configure branching, so usage is much easier than 'targets' alone.\n For the underlying methodology, please refer\n to the documentation of 'targets' and 'JAGS'\n (Plummer 2003) .", - "name": "jagstargets: Targets for JAGS Workflows", + "description": "Bayesian data analysis usually incurs long runtimes and cumbersome custom code. A pipeline toolkit tailored to Bayesian statisticians, the 'jagstargets' R package is leverages 'targets' and 'R2jags' to ease this burden. 'jagstargets' makes it super easy to set up scalable JAGS pipelines that automatically parallelize the computation and skip expensive steps when the results are already up to date. Minimal custom code is required, and there is no need to manually configure branching, so usage is much easier than 'targets' alone. For the underlying methodology, please refer to the documentation of 'targets' and 'JAGS' (Plummer 2003) .", + "name": "jagstargets: Targets for JAGS Pipelines", + "relatedLink": "https://docs.ropensci.org/jagstargets/", "codeRepository": "https://github.com/ropensci/jagstargets", - "relatedLink": [ - "https://docs.ropensci.org/jagstargets/" - ], "issueTracker": "https://github.com/ropensci/jagstargets/issues", "license": "https://spdx.org/licenses/MIT", - "version": "0.0.0.9001", + "version": "1.1.0.9002", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", "url": "https://r-project.org" }, - "runtimePlatform": "R version 4.1.0 (2021-05-18)", + "runtimePlatform": "R version 4.3.2 (2023-10-31)", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, "author": [ { "@type": "Person", "givenName": ["William", "Michael"], "familyName": "Landau", - "email": "will.landau@gmail.com", + "email": "will.landau.oss@gmail.com", "@id": "https://orcid.org/0000-0003-1878-3253" } ], - "contributor": {}, "copyrightHolder": [ { "@type": "Organization", "name": "Eli Lilly and Company" } ], - "funder": {}, "maintainer": [ { "@type": "Person", "givenName": ["William", "Michael"], "familyName": "Landau", - "email": "will.landau@gmail.com", + "email": "will.landau.oss@gmail.com", "@id": "https://orcid.org/0000-0003-1878-3253" } ], @@ -152,14 +151,14 @@ "sameAs": "https://CRAN.R-project.org/package=visNetwork" } ], - "softwareRequirements": [ - { + "softwareRequirements": { + "1": { "@type": "SoftwareApplication", "identifier": "R", "name": "R", "version": ">= 3.5.0" }, - { + "2": { "@type": "SoftwareApplication", "identifier": "coda", "name": "coda", @@ -172,20 +171,7 @@ }, "sameAs": "https://CRAN.R-project.org/package=coda" }, - { - "@type": "SoftwareApplication", - "identifier": "digest", - "name": "digest", - "version": ">= 0.6.25", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=digest" - }, - { + "3": { "@type": "SoftwareApplication", "identifier": "fst", "name": "fst", @@ -198,7 +184,7 @@ }, "sameAs": "https://CRAN.R-project.org/package=fst" }, - { + "4": { "@type": "SoftwareApplication", "identifier": "posterior", "name": "posterior", @@ -211,7 +197,7 @@ }, "sameAs": "https://CRAN.R-project.org/package=posterior" }, - { + "5": { "@type": "SoftwareApplication", "identifier": "purrr", "name": "purrr", @@ -224,7 +210,7 @@ }, "sameAs": "https://CRAN.R-project.org/package=purrr" }, - { + "6": { "@type": "SoftwareApplication", "identifier": "qs", "name": "qs", @@ -237,7 +223,7 @@ }, "sameAs": "https://CRAN.R-project.org/package=qs" }, - { + "7": { "@type": "SoftwareApplication", "identifier": "R2jags", "name": "R2jags", @@ -250,7 +236,20 @@ }, "sameAs": "https://CRAN.R-project.org/package=R2jags" }, - { + "8": { + "@type": "SoftwareApplication", + "identifier": "rjags", + "name": "rjags", + "version": ">= 4.10", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=rjags" + }, + "9": { "@type": "SoftwareApplication", "identifier": "rlang", "name": "rlang", @@ -263,29 +262,29 @@ }, "sameAs": "https://CRAN.R-project.org/package=rlang" }, - { + "10": { "@type": "SoftwareApplication", - "identifier": "rjags", - "name": "rjags", - "version": ">= 4.10", + "identifier": "secretbase", + "name": "secretbase", + "version": ">= 0.4.0", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", "name": "Comprehensive R Archive Network (CRAN)", "url": "https://cran.r-project.org" }, - "sameAs": "https://CRAN.R-project.org/package=rjags" + "sameAs": "https://CRAN.R-project.org/package=secretbase" }, - { + "11": { "@type": "SoftwareApplication", "identifier": "stats", "name": "stats" }, - { + "12": { "@type": "SoftwareApplication", "identifier": "targets", "name": "targets", - "version": ">= 0.6.0", + "version": ">= 1.6.0", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -294,11 +293,11 @@ }, "sameAs": "https://CRAN.R-project.org/package=targets" }, - { + "13": { "@type": "SoftwareApplication", "identifier": "tarchetypes", "name": "tarchetypes", - "version": ">= 0.0.1", + "version": ">= 0.8.0", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -307,7 +306,7 @@ }, "sameAs": "https://CRAN.R-project.org/package=tarchetypes" }, - { + "14": { "@type": "SoftwareApplication", "identifier": "tibble", "name": "tibble", @@ -320,17 +319,29 @@ }, "sameAs": "https://CRAN.R-project.org/package=tibble" }, - { + "15": { + "@type": "SoftwareApplication", + "identifier": "tidyselect", + "name": "tidyselect", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=tidyselect" + }, + "16": { "@type": "SoftwareApplication", "identifier": "tools", "name": "tools" }, - { + "17": { "@type": "SoftwareApplication", "identifier": "utils", "name": "utils" }, - { + "18": { "@type": "SoftwareApplication", "identifier": "withr", "name": "withr", @@ -343,28 +354,43 @@ }, "sameAs": "https://CRAN.R-project.org/package=withr" }, + "SystemRequirements": "JAGS 4.x.y (https://mcmc-jags.sourceforge.net)" + }, + "fileSize": "266.732KB", + "citation": [ { - "@type": "SoftwareApplication", - "identifier": "https://sysreqs.r-hub.io/get/jags" + "@type": "ScholarlyArticle", + "datePublished": "2021", + "author": [ + { + "@type": "Person", + "givenName": ["William", "Michael"], + "familyName": "Landau" + } + ], + "name": "The jagstargets R package: a reproducible workflow framework for Bayesian data analysis with JAGS", + "url": "https://doi.org/10.21105/joss.03877", + "pagination": "3877", + "isPartOf": { + "@type": "PublicationIssue", + "issueNumber": "68", + "datePublished": "2021", + "isPartOf": { + "@type": ["PublicationVolume", "Periodical"], + "volumeNumber": "6", + "name": "Journal of Open Source Software" + } + } } ], + "releaseNotes": "https://github.com/ropensci/jagstargets/blob/master/NEWS.md", "readme": "https://github.com/ropensci/jagstargets/blob/main/README.md", - "fileSize": "257.7KB", - "contIntegration": ["https://github.com/ropensci/jagstargets/actions?query=workflow%3Acheck", "https://codecov.io/gh/ropensci/jagstargets", "https://github.com/ropensci/jagstargets/actions?query=workflow%3Alint"], + "contIntegration": ["https://github.com/ropensci/jagstargets/actions?query=workflow%3Acheck", "https://app.codecov.io/gh/ropensci/gittargets", "https://github.com/ropensci/jagstargets/actions?query=workflow%3Alint"], "developmentStatus": "https://www.repostatus.org/#active", - "keywords": [ - "r", - "rstats", - "reproducibility", - "high-performance-computing", - "bayesian", - "jags", - "rjags", - "statistics", - "targets", - "make", - "rstats-package", - "r-targetopia" - ], - "releaseNotes": "https://github.com/ropensci/jagstargets/blob/master/NEWS.md" + "review": { + "@type": "Review", + "url": "https://github.com/ropensci/software-review/issues/425", + "provider": "https://ropensci.org" + }, + "keywords": ["r", "rstats", "reproducibility", "high-performance-computing", "bayesian", "jags", "rjags", "statistics", "targets", "make", "rstats-package", "r-targetopia"] }