Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

wlandau
Copy link
Member

@wlandau wlandau commented Jun 1, 2021

Prework

Related GitHub issues and pull requests

Summary

With efforts like Target Markdown and https://github.com/wlandau/targets-shiny, targets is becoming more of a backend tool. That means it needs to be more configurable. As of this PR, targets now has functionality to configure the target script file (default: _targets.R), the data store (default: _targets/), and the YAML file with configuration settings (default: _targets.yaml). You can override the settings for a function call using the script and store arguments (and the config argument of tar_watch() and tar_watch_server()).

With the exception of tar_config_set(), the arguments script, store, and config operate by temporarily modifying in-memory global config settings. This technique avoids a lot of painful refactoring, but it also means these arguments will cause bugs if R ever becomes arbitrarily multithreaded. Since arbitrary multithreading is almost surely never going to happen, I am willing to make this tradeoff. Knowing what I know now, if I were to design targets from the beginning, I would delegate the file paths to various internal classes. But doing that at this stage would be a staggering amount of effort for something that is never going to impact usage or maintainability.

@wlandau
Copy link
Member Author

wlandau commented Jun 1, 2021

cc @nsheff. You can now do things like tar_read(your_target, store = "store/from/another/project").

@wlandau wlandau merged commit 807014e into main Jun 1, 2021
@wlandau wlandau deleted the 477 branch June 1, 2021 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant