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 committed Apr 5, 2024
1 parent 3aff790 commit 9de10e6
Show file tree
Hide file tree
Showing 12 changed files with 125 additions and 121 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Description: Function-oriented Make-like declarative pipelines for
reproducible pipelines concisely and compactly.
The methods in this package were influenced by the 'drake' R package
by Will Landau (2018) <doi:10.21105/joss.00550>.
Version: 0.8.0.9000
Version: 0.8.0.9001
License: MIT + file LICENSE
URL: https://docs.ropensci.org/tarchetypes/, https://github.com/ropensci/tarchetypes
BugReports: https://github.com/ropensci/tarchetypes/issues
Expand Down Expand Up @@ -40,11 +40,11 @@ Authors@R: c(
Depends:
R (>= 3.5.0)
Imports:
digest (>= 0.6.25),
dplyr (>= 1.0.0),
fs (>= 1.4.2),
parallel,
rlang (>= 0.4.7),
secretbase (>= 0.4.0),
targets (>= 1.6.0),
tibble (>= 3.0.1),
tidyselect (>= 1.1.0),
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ export(tar_torch)
export(tar_url)
export(walk_ast)
export(walk_call_knitr)
importFrom(digest,digest)
importFrom(dplyr,bind_rows)
importFrom(dplyr,mutate)
importFrom(dplyr,select)
Expand All @@ -148,6 +147,7 @@ importFrom(rlang,expr)
importFrom(rlang,inform)
importFrom(rlang,is_missing)
importFrom(rlang,quo_squash)
importFrom(secretbase,siphash13)
importFrom(targets,tar_assert_chr)
importFrom(targets,tar_assert_dbl)
importFrom(targets,tar_assert_df)
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# tarchetypes 0.8.0.9000 (development)
# tarchetypes 0.8.0.9001 (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()`.

# tarchetypes 0.8.0

Expand Down
8 changes: 1 addition & 7 deletions R/tar_map.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,7 @@ tar_map_produce_suffix <- function(values, names) {
}

tar_map_default_suffixes <- function(values) {
id <- apply(
X = values,
MARGIN = 1,
FUN = digest::digest,
algo = "xxhash32"
)
list(id = id)
list(id = apply(X = values, MARGIN = 1, FUN = hash_object))
}

tar_map_target <- function(target, values, descriptions) {
Expand Down
2 changes: 1 addition & 1 deletion R/tar_package.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
#' convenient helper functions to create specialized targets, making
#' pipelines in targets easier and cleaner to write and understand.
#' @name tarchetypes-package
#' @importFrom digest digest
#' @importFrom dplyr bind_rows mutate select
#' @importFrom fs dir_create is_dir path_ext path_ext_remove
#' path_ext_set path_rel
#' @importFrom parallel clusterCall clusterMap makePSOCKcluster parLapply
#' stopCluster
#' @importFrom rlang as_function call2 check_installed enquo expr
#' inform is_missing quo_squash
#' @importFrom secretbase siphash13
#' @importFrom targets tar_assert_chr tar_assert_dbl tar_assert_df
#' tar_assert_envir tar_assert_equal_lengths
#' tar_assert_expr tar_assert_file tar_assert_flag
Expand Down
4 changes: 1 addition & 3 deletions R/tar_render_rep_raw.R
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,5 @@ tar_render_rep_rep <- function(rep, params, args, path, seeds) {
}

tar_render_rep_default_path <- function(path, params) {
out <- fs::path_ext_remove(path)
hash <- digest::digest(params, algo = "xxhash32")
sprintf("%s_%s", out, hash)
sprintf("%s_%s", fs::path_ext_remove(path), hash_object(params))
}
7 changes: 0 additions & 7 deletions R/utils_data.R

This file was deleted.

7 changes: 7 additions & 0 deletions R/utils_hash.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
hash_object <- function(object) {
secretbase::siphash13(x = object)
}

hash_rows <- function(data) {
make.unique(map_rows(data, hash_object), sep = "_")
}
142 changes: 70 additions & 72 deletions codemeta.json
Original file line number Diff line number Diff line change
@@ -1,50 +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": "tarchetypes",
"description": "Function-oriented Make-like declarative workflows for\n Statistics and data science are supported in the 'targets' R package.\n As an extension to 'targets', the 'tarchetypes' package provides\n convenient user-side functions to make 'targets' easier to use.\n By establishing reusable archetypes for common kinds of\n targets and pipelines, these functions help express complicated\n reproducible workflows concisely and compactly.\n The methods in this package were influenced by the 'drake' R package\n by Will Landau (2018) <doi:10.21105/joss.00550>.",
"description": "Function-oriented Make-like declarative pipelines for Statistics and data science are supported in the 'targets' R package. As an extension to 'targets', the 'tarchetypes' package provides convenient user-side functions to make 'targets' easier to use. By establishing reusable archetypes for common kinds of targets and pipelines, these functions help express complicated reproducible pipelines concisely and compactly. The methods in this package were influenced by the 'drake' R package by Will Landau (2018) <doi:10.21105/joss.00550>.",
"name": "tarchetypes: Archetypes for Targets",
"relatedLink": ["https://docs.ropensci.org/tarchetypes/", "https://CRAN.R-project.org/package=tarchetypes"],
"codeRepository": "https://github.com/ropensci/tarchetypes",
"relatedLink": [
"https://docs.ropensci.org/tarchetypes",
"https://docs.ropensci.org/tarchetypes/",
"https://CRAN.R-project.org/package=tarchetypes"
],
"issueTracker": "https://github.com/ropensci/tarchetypes/issues",
"license": "https://spdx.org/licenses/MIT",
"version": "0.4.1",
"version": "0.8.0.9001",
"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"
}
],
Expand Down Expand Up @@ -75,6 +72,19 @@
},
"sameAs": "https://CRAN.R-project.org/package=knitr"
},
{
"@type": "SoftwareApplication",
"identifier": "quarto",
"name": "quarto",
"version": ">= 1.4",
"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=quarto"
},
{
"@type": "SoftwareApplication",
"identifier": "rmarkdown",
Expand Down Expand Up @@ -115,27 +125,14 @@
"sameAs": "https://CRAN.R-project.org/package=xml2"
}
],
"softwareRequirements": [
{
"softwareRequirements": {
"1": {
"@type": "SoftwareApplication",
"identifier": "R",
"name": "R",
"version": ">= 3.5.0"
},
{
"@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"
},
{
"2": {
"@type": "SoftwareApplication",
"identifier": "dplyr",
"name": "dplyr",
Expand All @@ -148,7 +145,7 @@
},
"sameAs": "https://CRAN.R-project.org/package=dplyr"
},
{
"3": {
"@type": "SoftwareApplication",
"identifier": "fs",
"name": "fs",
Expand All @@ -161,7 +158,12 @@
},
"sameAs": "https://CRAN.R-project.org/package=fs"
},
{
"4": {
"@type": "SoftwareApplication",
"identifier": "parallel",
"name": "parallel"
},
"5": {
"@type": "SoftwareApplication",
"identifier": "rlang",
"name": "rlang",
Expand All @@ -174,11 +176,24 @@
},
"sameAs": "https://CRAN.R-project.org/package=rlang"
},
{
"6": {
"@type": "SoftwareApplication",
"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=secretbase"
},
"7": {
"@type": "SoftwareApplication",
"identifier": "targets",
"name": "targets",
"version": ">= 0.6.0",
"version": ">= 1.6.0",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand All @@ -187,7 +202,7 @@
},
"sameAs": "https://CRAN.R-project.org/package=targets"
},
{
"8": {
"@type": "SoftwareApplication",
"identifier": "tibble",
"name": "tibble",
Expand All @@ -200,7 +215,7 @@
},
"sameAs": "https://CRAN.R-project.org/package=tibble"
},
{
"9": {
"@type": "SoftwareApplication",
"identifier": "tidyselect",
"name": "tidyselect",
Expand All @@ -213,12 +228,12 @@
},
"sameAs": "https://CRAN.R-project.org/package=tidyselect"
},
{
"10": {
"@type": "SoftwareApplication",
"identifier": "utils",
"name": "utils"
},
{
"11": {
"@type": "SoftwareApplication",
"identifier": "vctrs",
"name": "vctrs",
Expand All @@ -231,7 +246,7 @@
},
"sameAs": "https://CRAN.R-project.org/package=vctrs"
},
{
"12": {
"@type": "SoftwareApplication",
"identifier": "withr",
"name": "withr",
Expand All @@ -243,37 +258,10 @@
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=withr"
}
],
"releaseNotes": "https://github.com/ropensci/tarchetypes/blob/master/NEWS.md",
"readme": "https://github.com/ropensci/tarchetypes/blob/main/README.md",
"fileSize": "857.081KB",
"contIntegration": ["https://github.com/ropensci/tarchetypes/actions?query=workflow%3Acheck", "https://app.codecov.io/gh/ropensci/tarchetypes", "https://github.com/ropensci/tarchetypes/actions?query=workflow%3Alint"],
"developmentStatus": "https://www.repostatus.org/#active",
"review": {
"@type": "Review",
"url": "https://github.com/ropensci/software-review/issues/401",
"provider": "https://ropensci.org"
},
"keywords": [
"reproducibility",
"high-performance-computing",
"r",
"data-science",
"rstats",
"pipeline",
"r-package",
"workflow",
"targets",
"r-targetopia",
"peer-reviewed"
],
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"SystemRequirements": null
},
"fileSize": "1209.095KB",
"citation": [
{
"@type": "SoftwareSourceCode",
Expand All @@ -288,5 +276,15 @@
"name": "tarchetypes: Archetypes for Targets",
"description": "{https://docs.ropensci.org/tarchetypes/, https://github.com/ropensci/tarchetypes}"
}
]
],
"releaseNotes": "https://github.com/ropensci/tarchetypes/blob/master/NEWS.md",
"readme": "https://github.com/ropensci/tarchetypes/blob/main/README.md",
"contIntegration": ["https://github.com/ropensci/tarchetypes/actions?query=workflow%3Acheck", "https://app.codecov.io/gh/ropensci/tarchetypes", "https://github.com/ropensci/tarchetypes/actions?query=workflow%3Alint"],
"developmentStatus": "https://www.repostatus.org/#active",
"review": {
"@type": "Review",
"url": "https://github.com/ropensci/software-review/issues/401",
"provider": "https://ropensci.org"
},
"keywords": ["reproducibility", "high-performance-computing", "r", "data-science", "rstats", "pipeline", "r-package", "workflow", "targets", "r-targetopia", "peer-reviewed"]
}
Loading

0 comments on commit 9de10e6

Please sign in to comment.