diff --git a/articles/collaboration.html b/articles/collaboration.html index b14337a1..7695c52a 100644 --- a/articles/collaboration.html +++ b/articles/collaboration.html @@ -219,11 +219,11 @@

An example
 id <- orderly2::orderly_run("data")
-##  Starting packet 'data' `20231003-095631-31f74b7d` at 2023-10-03 09:56:31.213849
+##  Starting packet 'data' `20231004-080923-c335c2a5` at 2023-10-04 08:09:23.775285
 ## > orderly2::orderly_artefact("Final data", "data.rds")
 ## > saveRDS(mtcars, "data.rds")
 ##  Finished running orderly.R
-##  Finished 20231003-095631-31f74b7d at 2023-10-03 09:56:31.33207 (0.1182208 secs)
+## Finished 20231004-080923-c335c2a5 at 2023-10-04 08:09:23.851522 (0.07623744 secs)

Perhaps it takes several goes for Alice to be happy with the analysis, but at some point she has something ready to share. She can then “push” the final packet up onto their server:

@@ -247,18 +247,18 @@

An example= "data", options = list(allow_remote = TRUE, pull_metadata = TRUE)) ## id name parameters -## 1 20231003-095631-31f74b7d data +## 1 20231004-080923-c335c2a5 data

Having seen there is a new “data” packet here, he can pull this down locally (TODO: mrc-4414 makes this nicer):

 orderly2::orderly_location_pull_packet(id)
 ##  Looking for suitable files already on disk
 ##  Need to fetch 2 files (1.3 kB) from 1 location
-## ⠙ Fetching file 1/2 (1.2 kB) from 'server' | ETA:  0s [7ms]
-##  Fetched 2 files (1.3 kB) from 'server' in 43ms.
+## ⠙ Fetching file 1/2 (1.2 kB) from 'server' | ETA:  0s [5ms]
+##  Fetched 2 files (1.3 kB) from 'server' in 31ms.
 ## 

Now Bob is in a position to develop against the same packet that -Alice ran (20231003-095631-31f74b7d)

+Alice ran (20231004-080923-c335c2a5)

Possible working patterns diff --git a/articles/dependencies.html b/articles/dependencies.html index 20ceb930..60f92326 100644 --- a/articles/dependencies.html +++ b/articles/dependencies.html @@ -153,16 +153,16 @@

Basic usevignette("introduction"), to get us started).

 id1 <- orderly2::orderly_run("data", root = path)
-##  Starting packet 'data' `20231003-095636-088eab7c` at 2023-10-03 09:56:36.039729
+##  Starting packet 'data' `20231004-080927-567483f7` at 2023-10-04 08:09:27.341802
 ## > d <- read.csv("data.csv")
 ## > d$z <- resid(lm(y ~ x, d))
 ## > saveRDS(d, "data.rds")
 ##  Finished running orderly.R
-##  Finished 20231003-095636-088eab7c at 2023-10-03 09:56:36.114331 (0.07460165 secs)
+##  Finished 20231004-080927-567483f7 at 2023-10-04 08:09:27.386037 (0.04423475 secs)
 id2 <- orderly2::orderly_run("analysis", root = path)
-##  Starting packet 'analysis' `20231003-095636-2845066e` at 2023-10-03 09:56:36.163851
+##  Starting packet 'analysis' `20231004-080927-6a143911` at 2023-10-04 08:09:27.418132
 ## > orderly2::orderly_dependency("data", "latest()", "data.rds")
-##  Depending on data @ `20231003-095636-088eab7c` (via latest(name == "data"))
+##  Depending on data @ `20231004-080927-567483f7` (via latest(name == "data"))
 ## > d <- readRDS("data.rds")
 ## > png("analysis.png")
 ## > plot(y ~ x, d)
@@ -170,14 +170,14 @@ 

Basic use## agg_png ## 2 ## Finished running orderly.R -## Finished 20231003-095636-2845066e at 2023-10-03 09:56:36.327224 (0.1633728 secs)

+## Finished 20231004-080927-6a143911 at 2023-10-04 08:09:27.606599 (0.1884673 secs)

When we look at the metadata for the packet created from the analysis report, we can see it has used -20231003-095636-088eab7c as its dependency:

+20231004-080927-567483f7 as its dependency:

 orderly2::orderly_metadata(id2, root = path)$depends
 ##                     packet                  query        files
-## 1 20231003-095636-088eab7c latest(name == "data") data.rds....
+## 1 20231004-080927-567483f7 latest(name == "data") data.rds....

(indeed it had to, there is only one copy of the data packet to pick from).

@@ -202,35 +202,35 @@

Filtering candidates by parametersWe can run this for several values of cyl:

 orderly2::orderly_run("data", list(cyl = 4), root = path)
-##  Starting packet 'data' `20231003-095636-e03744a4` at 2023-10-03 09:56:36.881973
+##  Starting packet 'data' `20231004-080928-073db51f` at 2023-10-04 08:09:28.032516
 ##  Parameters:
 ## • cyl: 4
 ## > orderly2::orderly_parameters(cyl = NULL)
 ## > d <- mtcars[mtcars$cyl == cyl, ]
 ## > saveRDS(d, "data.rds")
 ##  Finished running orderly.R
-##  Finished 20231003-095636-e03744a4 at 2023-10-03 09:56:36.943391 (0.06141782 secs)
-## [1] "20231003-095636-e03744a4"
+##  Finished 20231004-080928-073db51f at 2023-10-04 08:09:28.076217 (0.04370141 secs)
+## [1] "20231004-080928-073db51f"
 orderly2::orderly_run("data", list(cyl = 6), root = path)
-##  Starting packet 'data' `20231003-095636-f97b7507` at 2023-10-03 09:56:36.979977
+##  Starting packet 'data' `20231004-080928-19602cb6` at 2023-10-04 08:09:28.103111
 ##  Parameters:
 ## • cyl: 6
 ## > orderly2::orderly_parameters(cyl = NULL)
 ## > d <- mtcars[mtcars$cyl == cyl, ]
 ## > saveRDS(d, "data.rds")
 ##  Finished running orderly.R
-##  Finished 20231003-095636-f97b7507 at 2023-10-03 09:56:37.041861 (0.06188345 secs)
-## [1] "20231003-095636-f97b7507"
+##  Finished 20231004-080928-19602cb6 at 2023-10-04 08:09:28.146066 (0.04295492 secs)
+## [1] "20231004-080928-19602cb6"
 orderly2::orderly_run("data", list(cyl = 8), root = path)
-##  Starting packet 'data' `20231003-095637-15244104` at 2023-10-03 09:56:37.088557
+##  Starting packet 'data' `20231004-080928-2cbbb213` at 2023-10-04 08:09:28.178881
 ##  Parameters:
 ## • cyl: 8
 ## > orderly2::orderly_parameters(cyl = NULL)
 ## > d <- mtcars[mtcars$cyl == cyl, ]
 ## > saveRDS(d, "data.rds")
 ##  Finished running orderly.R
-##  Finished 20231003-095637-15244104 at 2023-10-03 09:56:37.140255 (0.05169845 secs)
-## [1] "20231003-095637-15244104"
+## Finished 20231004-080928-2cbbb213 at 2023-10-04 08:09:28.21488 (0.0359993 secs) +## [1] "20231004-080928-2cbbb213"

Our follow-on analysis contains:

 orderly2::orderly_parameters(cyl = NULL)
@@ -248,7 +248,7 @@ 

Filtering candidates by parametersthis:cyl).

+## Finished 20231004-080928-636b961d at 2023-10-04 08:09:28.463194 (0.07053256 secs) +## [1] "20231004-080928-636b961d"

Interpreting errors @@ -273,7 +273,7 @@

Interpreting errors
 orderly2::orderly_run("analysis", list(cyl = 9000), root = path)
-##  Starting packet 'analysis' `20231003-095637-96e0611e` at 2023-10-03 09:56:37.595574
+##  Starting packet 'analysis' `20231004-080928-8f7af19c` at 2023-10-04 08:09:28.564735
 ##  Parameters:
 ## • cyl: 9000
 ## > orderly2::orderly_parameters(cyl = NULL)
@@ -282,7 +282,7 @@ 

Interpreting errors## + "latest(parameter:cyl == this:cyl)", ## + "data.rds") ## Error running orderly.R -## Finished 20231003-095637-96e0611e at 2023-10-03 09:56:37.719587 (0.1240129 secs) +## Finished 20231004-080928-8f7af19c at 2023-10-04 08:09:28.653859 (0.0891242 secs) ## Error in `orderly2::orderly_run()`: ## ! Failed to run report ## Caused by error in `outpack_packet_use_dependency()`: @@ -339,8 +339,8 @@

Interpreting errors## [1] 3 ## ## $found -## [1] "20231003-095636-e03744a4" "20231003-095636-f97b7507" -## [3] "20231003-095637-15244104"

+## [1] "20231004-080928-073db51f" "20231004-080928-19602cb6" +## [3] "20231004-080928-2cbbb213"

(this would have worked with rlang::last_error()$explanation$parts$A too).

You can also use orderly2::orderly_metadata_extract to @@ -351,9 +351,9 @@

Interpreting errors= c(cyl = "parameters.cyl is number"), root = path) ## id cyl -## 1 20231003-095636-e03744a4 4 -## 2 20231003-095636-f97b7507 6 -## 3 20231003-095637-15244104 8 +## 1 20231004-080928-073db51f 4 +## 2 20231004-080928-19602cb6 6 +## 3 20231004-080928-2cbbb213 8

Filtering candidates in other ways @@ -367,7 +367,7 @@

Filtering candidates in other wayslatest(parameter:cyl == environment:cyl) to match against whatever value cyl took in the evaluating environment.

Instead of a query, you can provide a single id (e.g, -20231003-095637-5d76d45d), which would mean that even as +20231004-080928-636b961d), which would mean that even as new copies of the data packet are created, this dependency will always resolve to the same value.

You can chain together logical operations with diff --git a/articles/introduction.html b/articles/introduction.html index 96c5e781..3e0519c6 100644 --- a/articles/introduction.html +++ b/articles/introduction.html @@ -113,7 +113,7 @@

Creating an empty orderly reposito
 path <- tempfile() # we'll use a temporary directory here
 orderly2::orderly_init(path)
-##  Created orderly root at '/tmp/RtmpbCbE7C/file1c097c91522b'
+## Created orderly root at '/tmp/RtmpNJqyHD/file1c853b995686'

which creates a few files:

## .
 ## ├── .outpack
@@ -161,14 +161,14 @@ 

Creating your first orderly reportorderly2::orderly_run():

 id <- orderly2::orderly_run("incoming_data", root = path)
-##  Starting packet 'incoming_data' `20231003-095643-0d123dd9` at 2023-10-03 09:56:43.060596
+##  Starting packet 'incoming_data' `20231004-080932-6ea60175` at 2023-10-04 08:09:32.438523
 ## > d <- read.csv("data.csv")
 ## > d$z <- resid(lm(y ~ x, d))
 ## > saveRDS(d, "data.rds")
 ##  Finished running orderly.R
-##  Finished 20231003-095643-0d123dd9 at 2023-10-03 09:56:43.186493 (0.1258976 secs)
+##  Finished 20231004-080932-6ea60175 at 2023-10-04 08:09:32.519363 (0.08083987 secs)
 id
-## [1] "20231003-095643-0d123dd9"
+## [1] "20231004-080932-6ea60175"

The id that is created is a new identifier for the packet that will be both unique among all packets (within reason) and chronologically sortable. A packet that has an id that sorts after @@ -177,7 +177,7 @@

Creating your first orderly report## . ## ├── archive ## │ └── incoming_data -## │ └── 20231003-095643-0d123dd9 +## │ └── 20231004-080932-6ea60175 ## │ ├── data.csv ## │ ├── data.rds ## │ └── orderly.R @@ -190,7 +190,7 @@

Creating your first orderly report## └── orderly.R

A few things have changed here: