ropensci / gittargets

Data version control for reproducible analysis pipelines in R with {targets}.
https://docs.ropensci.org/gittargets/
Other
87 stars 1 forks source link

Supersede gittargets? #18

Open wlandau opened 3 hours ago

wlandau commented 3 hours ago

Content-addressable storage (CAS), recently added to targets, is a more native and elegant way to achieve the original goals of gittargets. Demonstration:

library(targets)

# Run the first version
tar_script(tar_target(x, 1, repository = tar_repository_cas_local()))
tar_make(reporter = "silent")

# Stash the metadata (would use Git in real life)
temp <- file.copy("_targets/meta/meta", "first_meta")

# Run the second version
tar_script(tar_target(x, 2, repository = tar_repository_cas_local()))
tar_make(reporter = "silent")

# Revert to the first version and skip target x.
file.copy("first_meta", "_targets/meta/meta", overwrite = TRUE)
#> [1] TRUE
tar_script(tar_target(x, 1, repository = tar_repository_cas_local()))
tar_make()
#> ✔ skipped target x
#> ✔ skipped pipeline [0.041 seconds]

Created on 2024-11-18 with reprex v2.1.1

wlandau commented 3 hours ago

I will want to at least wait until the release of targets 1.9.0 reaches CRAN. (It may take a couple days because there was a revdep check problem with jagstargets, and I need jagstargets 1.2.2 to populate on CRAN servers.)