diff --git a/articles/collaboration.html b/articles/collaboration.html index b09c1af6..7feb3e38 100644 --- a/articles/collaboration.html +++ b/articles/collaboration.html @@ -206,7 +206,7 @@

An example
 orderly2::orderly_init(".")
-##  Created orderly root at '/tmp/RtmpPKozZG/file1b374789a932/alice'
+##  Created orderly root at '/tmp/RtmpHevmPC/file1bc153bbf6f/alice'
 ##  Wrote '.gitignore'
 orderly2::orderly_list_src()
 ## [1] "data"
@@ -219,11 +219,11 @@

An example
 id <- orderly2::orderly_run("data")
-##  Starting packet 'data' `20240326-102849-cc3d9740` at 2024-03-26 10:28:49.804487
+##  Starting packet 'data' `20240404-083021-97e0548a` at 2024-04-04 08:30:21.600149
 ## > orderly2::orderly_artefact("Final data", "data.rds")
 ## > saveRDS(mtcars, "data.rds")
 ##  Finished running data.R
-##  Finished 20240326-102849-cc3d9740 at 2024-03-26 10:28:49.862746 (0.05825949 secs)
+## Finished 20240404-083021-97e0548a at 2024-04-04 08:30:21.659906 (0.05975723 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:

@@ -233,7 +233,7 @@

An example
 orderly2::orderly_init(".")
-##  Created orderly root at '/tmp/RtmpPKozZG/file1b374789a932/bob'
+##  Created orderly root at '/tmp/RtmpHevmPC/file1bc153bbf6f/bob'
 ##  Wrote '.gitignore'
 orderly2::orderly_location_add(
@@ -247,7 +247,7 @@ 

An example= "data", options = list(allow_remote = TRUE, pull_metadata = TRUE)) ## id name parameters -## 1 20240326-102849-cc3d9740 data

+## 1 20240404-083021-97e0548a data

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

@@ -255,10 +255,10 @@ 

An example## Looking for suitable files already on disk ## Need to fetch 2 files (1.3 kB) from 1 location ## ⠙ Fetching file 1/2 (81 B) from 'server' | ETA: 0s [3ms] -## Fetched 2 files (1.3 kB) from 'server' in 24ms. +## Fetched 2 files (1.3 kB) from 'server' in 26ms. ##

Now Bob is in a position to develop against the same packet that -Alice ran (20240326-102849-cc3d9740)

+Alice ran (20240404-083021-97e0548a)

Possible working patterns diff --git a/articles/dependencies.html b/articles/dependencies.html index 5b64961e..293e2d73 100644 --- a/articles/dependencies.html +++ b/articles/dependencies.html @@ -152,16 +152,16 @@

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

 id1 <- orderly2::orderly_run("data")
-##  Starting packet 'data' `20240326-102852-cdb0f2d0` at 2024-03-26 10:28:52.806702
+##  Starting packet 'data' `20240404-083024-ba999da2` at 2024-04-04 08:30:24.732329
 ## > d <- read.csv("data.csv")
 ## > d$z <- resid(lm(y ~ x, d))
 ## > saveRDS(d, "data.rds")
 ##  Finished running data.R
-##  Finished 20240326-102852-cdb0f2d0 at 2024-03-26 10:28:52.841872 (0.0351696 secs)
+##  Finished 20240404-083024-ba999da2 at 2024-04-04 08:30:24.770825 (0.03849626 secs)
 id2 <- orderly2::orderly_run("analysis")
-##  Starting packet 'analysis' `20240326-102852-df007fb1` at 2024-03-26 10:28:52.874111
+##  Starting packet 'analysis' `20240404-083024-cd5a81dc` at 2024-04-04 08:30:24.805401
 ## > orderly2::orderly_dependency("data", "latest()", "data.rds")
-##  Depending on data @ `20240326-102852-cdb0f2d0` (via latest(name == "data"))
+##  Depending on data @ `20240404-083024-ba999da2` (via latest(name == "data"))
 ## > d <- readRDS("data.rds")
 ## > png("analysis.png")
 ## > plot(y ~ x, d)
@@ -169,14 +169,14 @@ 

Basic use## agg_png ## 2 ## Finished running analysis.R -## Finished 20240326-102852-df007fb1 at 2024-03-26 10:28:53.003847 (0.1297367 secs)

+## Finished 20240404-083024-cd5a81dc at 2024-04-04 08:30:24.965723 (0.1603217 secs)

When we look at the metadata for the packet created from the analysis report, we can see it has used -20240326-102852-cdb0f2d0 as its dependency:

+20240404-083024-ba999da2 as its dependency:

 orderly2::orderly_metadata(id2)$depends
 ##                     packet                  query        files
-## 1 20240326-102852-cdb0f2d0 latest(name == "data") data.rds....
+## 1 20240404-083024-ba999da2 latest(name == "data") data.rds....

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

@@ -201,35 +201,35 @@

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

 orderly2::orderly_run("data", list(cyl = 4))
-##  Starting packet 'data' `20240326-102853-5f4a8dc0` at 2024-03-26 10:28:53.375361
+##  Starting packet 'data' `20240404-083025-56bb1e64` at 2024-04-04 08:30:25.341973
 ##  Parameters:
 ## • cyl: 4
 ## > orderly2::orderly_parameters(cyl = NULL)
 ## > d <- mtcars[mtcars$cyl == cyl, ]
 ## > saveRDS(d, "data.rds")
 ##  Finished running data.R
-##  Finished 20240326-102853-5f4a8dc0 at 2024-03-26 10:28:53.405129 (0.02976799 secs)
-## [1] "20240326-102853-5f4a8dc0"
+##  Finished 20240404-083025-56bb1e64 at 2024-04-04 08:30:25.371971 (0.02999783 secs)
+## [1] "20240404-083025-56bb1e64"
 orderly2::orderly_run("data", list(cyl = 6))
-##  Starting packet 'data' `20240326-102853-6cf7ce7b` at 2024-03-26 10:28:53.428689
+##  Starting packet 'data' `20240404-083025-646eb081` at 2024-04-04 08:30:25.395359
 ##  Parameters:
 ## • cyl: 6
 ## > orderly2::orderly_parameters(cyl = NULL)
 ## > d <- mtcars[mtcars$cyl == cyl, ]
 ## > saveRDS(d, "data.rds")
 ##  Finished running data.R
-##  Finished 20240326-102853-6cf7ce7b at 2024-03-26 10:28:53.455681 (0.02699184 secs)
-## [1] "20240326-102853-6cf7ce7b"
+##  Finished 20240404-083025-646eb081 at 2024-04-04 08:30:25.422142 (0.02678275 secs)
+## [1] "20240404-083025-646eb081"
 orderly2::orderly_run("data", list(cyl = 8))
-##  Starting packet 'data' `20240326-102853-7a65244d` at 2024-03-26 10:28:53.481173
+##  Starting packet 'data' `20240404-083025-7120b78e` at 2024-04-04 08:30:25.448045
 ##  Parameters:
 ## • cyl: 8
 ## > orderly2::orderly_parameters(cyl = NULL)
 ## > d <- mtcars[mtcars$cyl == cyl, ]
 ## > saveRDS(d, "data.rds")
 ##  Finished running data.R
-##  Finished 20240326-102853-7a65244d at 2024-03-26 10:28:53.508787 (0.02761459 secs)
-## [1] "20240326-102853-7a65244d"
+## Finished 20240404-083025-7120b78e at 2024-04-04 08:30:25.478135 (0.03009057 secs) +## [1] "20240404-083025-7120b78e"

Our follow-on analysis contains:

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

Filtering candidates by parametersthis:cyl).

+## Finished 20240404-083025-a128adfb at 2024-04-04 08:30:25.68827 (0.05543208 secs) +## [1] "20240404-083025-a128adfb"

Interpreting errors @@ -272,7 +272,7 @@

Interpreting errors
 orderly2::orderly_run("analysis", list(cyl = 9000))
-##  Starting packet 'analysis' `20240326-102853-cbd2039f` at 2024-03-26 10:28:53.799244
+##  Starting packet 'analysis' `20240404-083025-c63552a0` at 2024-04-04 08:30:25.777362
 ##  Parameters:
 ## • cyl: 9000
 ## > orderly2::orderly_parameters(cyl = NULL)
@@ -281,7 +281,7 @@ 

Interpreting errors## + "latest(parameter:cyl == this:cyl)", ## + "data.rds") ## Error running analysis.R -## Finished 20240326-102853-cbd2039f at 2024-03-26 10:28:53.864053 (0.06480861 secs) +## Finished 20240404-083025-c63552a0 at 2024-04-04 08:30:25.843449 (0.06608629 secs) ## Error in `orderly2::orderly_run()`: ## ! Failed to run report ## Caused by error in `outpack_packet_use_dependency()`: @@ -338,8 +338,8 @@

Interpreting errors## [1] 3 ## ## $found -## [1] "20240326-102853-5f4a8dc0" "20240326-102853-6cf7ce7b" -## [3] "20240326-102853-7a65244d"

+## [1] "20240404-083025-56bb1e64" "20240404-083025-646eb081" +## [3] "20240404-083025-7120b78e"

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

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

Interpreting errors= "data", extract = c(cyl = "parameters.cyl is number")) ## id cyl -## 1 20240326-102853-5f4a8dc0 4 -## 2 20240326-102853-6cf7ce7b 6 -## 3 20240326-102853-7a65244d 8 +## 1 20240404-083025-56bb1e64 4 +## 2 20240404-083025-646eb081 6 +## 3 20240404-083025-7120b78e 8

Filtering candidates in other ways @@ -365,7 +365,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, -20240326-102853-a824ca4a), which would mean that even as +20240404-083025-a128adfb), 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 5085d9dc..65624799 100644 --- a/articles/introduction.html +++ b/articles/introduction.html @@ -121,7 +121,7 @@

Creating an empty orderly reposito
 path <- tempfile() # we'll use a temporary directory here - see note below
 orderly2::orderly_init(path)
-##  Created orderly root at '/tmp/RtmplUlPtF/file1bc221f2f847'
+## Created orderly root at '/tmp/RtmpRt5Ybz/file1c4c2f92b832'

which creates a few files:

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

Creating your first orderly reportorderly2::orderly_run():

 id <- orderly2::orderly_run("incoming_data")
-##  Starting packet 'incoming_data' `20240326-102857-15d0e6c6` at 2024-03-26 10:28:57.090209
+##  Starting packet 'incoming_data' `20240404-083029-262c2dc4` at 2024-04-04 08:30:29.15411
 ## > d <- read.csv("data.csv")
 ## > d$z <- resid(lm(y ~ x, d))
 ## > saveRDS(d, "data.rds")
 ##  Finished running incoming_data.R
-##  Finished 20240326-102857-15d0e6c6 at 2024-03-26 10:28:57.154431 (0.06422257 secs)
+##  Finished 20240404-083029-262c2dc4 at 2024-04-04 08:30:29.218334 (0.06422424 secs)
 id
-## [1] "20240326-102857-15d0e6c6"
+## [1] "20240404-083029-262c2dc4"

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 @@ -199,7 +199,7 @@

Creating your first orderly report## . ## ├── archive ## │ └── incoming_data -## │ └── 20240326-102857-15d0e6c6 +## │ └── 20240404-083029-262c2dc4 ## │ ├── data.csv ## │ ├── data.rds ## │ └── incoming_data.R @@ -212,7 +212,7 @@

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

A few things have changed here: