Comments (9)
I am open to name suggestions. My thoughts so far:
tar_interval()
tar_periodically()
tar_age()
tar_schedule()
tar_delay()
tar_timer()
tar_frequently()
from tarchetypes.
I like tar_interval()
. Another possibility is tar_expire()
from tarchetypes.
tar_periodically()
and tar_expire()
seem intuitively closest to what is in the tin. I think it might be nice to stick to the tar_[noun]
pattern for target-generating functions, but nothing appropriate comes to mind.
tar_after()
, tar_timeout()
, tar_every()
, tar_timed()
come to mind otherwise.
from tarchetypes.
Thanks for the suggestions, they definitely help. After thinking it over, I like tar_difftime()
. Since I plan to have users pass a difftime
object to mark the interval, I find this to be clear and specific.
from tarchetypes.
And actually, there are at least two conceivable versions of tar_difftime()
: one to force a target to rerun when it gets old enough, another to suppress a target until it gets old enough. I think we just want the former.
from tarchetypes.
Let's first build some custom cues:
tar_cue_force(condition)
: equivalent totar_cue(mode = ifelse(any(condition), "always", "thorough"))
tar_cue_skip(condition)
: equivalent totar_cue(mode = ifelse(any(condition), "never", "thorough"))
tar_cue_age(name, age)
: equivalent totar_cue(mode = ifelse(any(Sys.time() - tar_timestamp_raw(name) > age), "always", "thorough"))
Then build tar_age()
for this issue on top of tar_cue_age()
. (I think I like that one more than tar_difftime()
.)
from tarchetypes.
Yes, my intuition initially was that I needed a special-purpose cue, so this makes good sense. For simplicity, age
could be input as just an integer denoting the number of seconds - though not sure what implications that would have for the internals doing the time comparison.
from tarchetypes.
tar_age()
and those cues I mentioned are now implemented.
For simplicity, age could be input as just an integer denoting the number of seconds - though not sure what implications that would have for the internals doing the time comparison.
I prefer difftime
because we don't know what scale of time the user is looking for. If it's seconds and most people turn out to want days, most users will end up supplying a high number for seconds and doing repetitive mental arithmetic.
from tarchetypes.
Related: turns out tar_age()
etc. can work with dynamic branching if we take the max timestamp (so all the branches rerun if the youngest branch's data becomes old enough).
from tarchetypes.
Related Issues (20)
- Local persistence of cloud-backed file targets HOT 5
- `tar_quarto()` always ends normally for quarto project even if there is error HOT 3
- `tar_quarto()` ignores `output_dir` in _quarto.yml when passed an individual file
- combine tar_cue_age with a conditional statement HOT 4
- Rep-specific seeds in tar_rep(), tar_map_rep(), etc. HOT 5
- optional garbage collection between reps of the `tar_rep*()` functions HOT 1
- tar_change repository not considered for change part
- Branches not in metadata: branches out of range
- GitHub interactions are temporarily limited because the maintainer is out of office.
- tar_cross() HOT 2
- Bug: `tar_quarto_rep()` throws an error if used together with `future::plan()` from _targets.R template HOT 1
- Support Quarto profiles? HOT 10
- Expose `tar_render()`, `tar_quarto()` and similar functions to the `deps` argument of `tar_target_raw()` HOT 8
- Errors and warnings with Quarto
- tar_quarto_rep doesn't work on reports in subdirectories HOT 2
- `retrieval = "none"` in quarto target factories HOT 2
- [general] Use `tar_rep()` and `tar_rep2()` inside of `tar_map()` HOT 2
- Allow trailing comma in `tar_map()` HOT 1
- Let `tar_map()` substitute more fields, e.g., `priority` HOT 2
- Safely allow tar_quarto() etc. to run the report from a custom working directory HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tarchetypes.