Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supersede gittargets? #18

Open
wlandau opened this issue Nov 18, 2024 · 2 comments
Open

Supersede gittargets? #18

wlandau opened this issue Nov 18, 2024 · 2 comments

Comments

@wlandau
Copy link
Member

wlandau commented Nov 18, 2024

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
Copy link
Member Author

wlandau commented Nov 18, 2024

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.)

@joelnitta
Copy link

This looks great! That would be amazing if it could be available that quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants