diff --git a/articles/collaboration.html b/articles/collaboration.html index 96e235ea..0d10b8dc 100644 --- a/articles/collaboration.html +++ b/articles/collaboration.html @@ -193,7 +193,7 @@

An example
 orderly2::orderly_init(".")
-##  Created orderly root at '/tmp/RtmpXFj1Og/file1a6b795204b0/alice'
+##  Created orderly root at '/tmp/RtmpAhPB8U/file1a08583bdeb7/alice'
 ##  Wrote '.gitignore'
 orderly2::orderly_list_src()
 ## [1] "data"
@@ -206,11 +206,11 @@

An example
 id <- orderly2::orderly_run("data")
-##  Starting packet 'data' `20240905-080221-6b00c525` at 2024-09-05 08:02:21.423466
+##  Starting packet 'data' `20240905-155204-ee6992a0` at 2024-09-05 15:52:04.937049
 ## > orderly2::orderly_artefact("data.rds", description = "Final data")
 ## > saveRDS(mtcars, "data.rds")
 ##  Finished running data.R
-##  Finished 20240905-080221-6b00c525 at 2024-09-05 08:02:21.478472 (0.05500579 secs)
+## Finished 20240905-155204-ee6992a0 at 2024-09-05 15:52:04.996184 (0.05913496 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:

@@ -220,7 +220,7 @@

An example
 orderly2::orderly_init(".")
-##  Created orderly root at '/tmp/RtmpXFj1Og/file1a6b795204b0/bob'
+##  Created orderly root at '/tmp/RtmpAhPB8U/file1a08583bdeb7/bob'
 ##  Wrote '.gitignore'
 orderly2::orderly_location_add(
@@ -234,18 +234,18 @@ 

An example= "data", options = list(allow_remote = TRUE, pull_metadata = TRUE)) ## id name parameters -## 1 20240905-080221-6b00c525 data

+## 1 20240905-155204-ee6992a0 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 (95 B) from 'server' | ETA:  0s [2ms]
-##  Fetched 2 files (1.3 kB) from 'server' in 19ms.
+## ⠙ Fetching file 1/2 (95 B) from 'server' | ETA:  0s [3ms]
+##  Fetched 2 files (1.3 kB) from 'server' in 20ms.
 ## 

Now Bob is in a position to develop against the same packet that -Alice ran (20240905-080221-6b00c525)

+Alice ran (20240905-155204-ee6992a0)

Possible working patterns @@ -402,7 +402,7 @@

Sharing p use_file_store = TRUE, require_complete_tree = TRUE ) -## Created orderly root at '/tmp/RtmpXFj1Og/file1a6b795204b0/sharepoint'

+## Created orderly root at '/tmp/RtmpAhPB8U/file1a08583bdeb7/sharepoint'

Create an orderly store with a file store and a complete tree. See orderly2::orderly_init() for more details.

diff --git a/articles/dependencies.html b/articles/dependencies.html index 1e71eb2f..b14ddd8d 100644 --- a/articles/dependencies.html +++ b/articles/dependencies.html @@ -138,16 +138,16 @@

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

 id1 <- orderly2::orderly_run("data")
-##  Starting packet 'data' `20240905-080224-b9674449` at 2024-09-05 08:02:24.726524
+##  Starting packet 'data' `20240905-155208-4ed119f9` at 2024-09-05 15:52:08.310439
 ## > d <- read.csv("data.csv")
 ## > d$z <- resid(lm(y ~ x, d))
 ## > saveRDS(d, "data.rds")
 ##  Finished running data.R
-##  Finished 20240905-080224-b9674449 at 2024-09-05 08:02:24.761707 (0.03518271 secs)
+##  Finished 20240905-155208-4ed119f9 at 2024-09-05 15:52:08.349091 (0.03865218 secs)
 id2 <- orderly2::orderly_run("analysis")
-##  Starting packet 'analysis' `20240905-080224-c961843d` at 2024-09-05 08:02:24.788789
+##  Starting packet 'analysis' `20240905-155208-60507729` at 2024-09-05 15:52:08.378635
 ## > orderly2::orderly_dependency("data", "latest()", "data.rds")
-##  Depending on data @ `20240905-080224-b9674449` (via latest(name == "data"))
+##  Depending on data @ `20240905-155208-4ed119f9` (via latest(name == "data"))
 ## > d <- readRDS("data.rds")
 ## > png("analysis.png")
 ## > plot(y ~ x, d)
@@ -155,14 +155,14 @@ 

Basic use## agg_png ## 2 ## Finished running analysis.R -## Finished 20240905-080224-c961843d at 2024-09-05 08:02:24.896412 (0.1076229 secs)

+## Finished 20240905-155208-60507729 at 2024-09-05 15:52:08.469095 (0.09046006 secs)

When we look at the metadata for the packet created from the analysis report, we can see it has used -20240905-080224-b9674449 as its dependency:

+20240905-155208-4ed119f9 as its dependency:

 orderly2::orderly_metadata(id2)$depends
 ##                     packet                  query        files
-## 1 20240905-080224-b9674449 latest(name == "data") data.rds....
+## 1 20240905-155208-4ed119f9 latest(name == "data") data.rds....

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

@@ -187,35 +187,35 @@

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

 orderly2::orderly_run("data", list(cyl = 4))
-##  Starting packet 'data' `20240905-080225-40f9c854` at 2024-09-05 08:02:25.256076
+##  Starting packet 'data' `20240905-155208-d7439145` at 2024-09-05 15:52:08.84341
 ##  Parameters:
 ## • cyl: 4
 ## > orderly2::orderly_parameters(cyl = NULL)
 ## > d <- mtcars[mtcars$cyl == cyl, ]
 ## > saveRDS(d, "data.rds")
 ##  Finished running data.R
-##  Finished 20240905-080225-40f9c854 at 2024-09-05 08:02:25.286214 (0.03013873 secs)
-## [1] "20240905-080225-40f9c854"
+##  Finished 20240905-155208-d7439145 at 2024-09-05 15:52:08.876495 (0.03308415 secs)
+## [1] "20240905-155208-d7439145"
 orderly2::orderly_run("data", list(cyl = 6))
-##  Starting packet 'data' `20240905-080225-4da56319` at 2024-09-05 08:02:25.30542
+##  Starting packet 'data' `20240905-155208-e5c4ca41` at 2024-09-05 15:52:08.899926
 ##  Parameters:
 ## • cyl: 6
 ## > orderly2::orderly_parameters(cyl = NULL)
 ## > d <- mtcars[mtcars$cyl == cyl, ]
 ## > saveRDS(d, "data.rds")
 ##  Finished running data.R
-##  Finished 20240905-080225-4da56319 at 2024-09-05 08:02:25.332333 (0.02691317 secs)
-## [1] "20240905-080225-4da56319"
+##  Finished 20240905-155208-e5c4ca41 at 2024-09-05 15:52:08.930287 (0.0303607 secs)
+## [1] "20240905-155208-e5c4ca41"
 orderly2::orderly_run("data", list(cyl = 8))
-##  Starting packet 'data' `20240905-080225-59e680b0` at 2024-09-05 08:02:25.353485
+##  Starting packet 'data' `20240905-155208-f3619169` at 2024-09-05 15:52:08.953167
 ##  Parameters:
 ## • cyl: 8
 ## > orderly2::orderly_parameters(cyl = NULL)
 ## > d <- mtcars[mtcars$cyl == cyl, ]
 ## > saveRDS(d, "data.rds")
 ##  Finished running data.R
-##  Finished 20240905-080225-59e680b0 at 2024-09-05 08:02:25.378441 (0.02495623 secs)
-## [1] "20240905-080225-59e680b0"
+## Finished 20240905-155208-f3619169 at 2024-09-05 15:52:08.979171 (0.02600336 secs) +## [1] "20240905-155208-f3619169"

Our follow-on analysis contains:

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

Filtering candidates by parametersthis:cyl).

+## Finished 20240905-155209-23026439 at 2024-09-05 15:52:09.190904 (0.05169082 secs) +## [1] "20240905-155209-23026439"

Interpreting errors @@ -258,7 +258,7 @@

Interpreting errors
 orderly2::orderly_run("analysis", list(cyl = 9000))
-##  Starting packet 'analysis' `20240905-080225-a81e462f` at 2024-09-05 08:02:25.658968
+##  Starting packet 'analysis' `20240905-155209-45ac12a6` at 2024-09-05 15:52:09.274588
 ##  Parameters:
 ## • cyl: 9000
 ## > orderly2::orderly_parameters(cyl = NULL)
@@ -267,7 +267,7 @@ 

Interpreting errors## + "latest(parameter:cyl == this:cyl)", ## + "data.rds") ## Error running analysis.R -## Finished 20240905-080225-a81e462f at 2024-09-05 08:02:25.717692 (0.05872464 secs) +## Finished 20240905-155209-45ac12a6 at 2024-09-05 15:52:09.336643 (0.06205487 secs) ## Error in `orderly2::orderly_run()`: ## ! Failed to run report ## Caused by error in `outpack_packet_use_dependency()`: @@ -324,8 +324,8 @@

Interpreting errors## [1] 3 ## ## $found -## [1] "20240905-080225-40f9c854" "20240905-080225-4da56319" -## [3] "20240905-080225-59e680b0"

+## [1] "20240905-155208-d7439145" "20240905-155208-e5c4ca41" +## [3] "20240905-155208-f3619169"

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

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

Interpreting errors= "data", extract = c(cyl = "parameters.cyl is number")) ## id cyl -## 1 20240905-080225-40f9c854 4 -## 2 20240905-080225-4da56319 6 -## 3 20240905-080225-59e680b0 8 +## 1 20240905-155208-d7439145 4 +## 2 20240905-155208-e5c4ca41 6 +## 3 20240905-155208-f3619169 8

Filtering candidates in other ways @@ -351,7 +351,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, -20240905-080225-8719a52e), which would mean that even as +20240905-155209-23026439), 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 15db74de..0674a433 100644 --- a/articles/introduction.html +++ b/articles/introduction.html @@ -107,7 +107,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/RtmpqAQMea/file1af65b7c91e8'
+## Created orderly root at '/tmp/Rtmp2hfGFo/file1a9488c66d5'

which creates a few files:

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

Creating your first orderly reportorderly2::orderly_run():

 id <- orderly2::orderly_run("incoming_data")
-##  Starting packet 'incoming_data' `20240905-080228-ca5e5af6` at 2024-09-05 08:02:28.794513
+##  Starting packet 'incoming_data' `20240905-155212-78e3f681` at 2024-09-05 15:52:12.476331
 ## > d <- read.csv("data.csv")
 ## > d$z <- resid(lm(y ~ x, d))
 ## > saveRDS(d, "data.rds")
 ##  Finished running incoming_data.R
-##  Finished 20240905-080228-ca5e5af6 at 2024-09-05 08:02:28.855893 (0.06137991 secs)
+##  Finished 20240905-155212-78e3f681 at 2024-09-05 15:52:12.53853 (0.06219864 secs)
 id
-## [1] "20240905-080228-ca5e5af6"
+## [1] "20240905-155212-78e3f681"

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

Creating your first orderly report## . ## ├── archive ## │ └── incoming_data -## │ └── 20240905-080228-ca5e5af6 +## │ └── 20240905-155212-78e3f681 ## │ ├── data.csv ## │ ├── data.rds ## │ └── incoming_data.R @@ -198,7 +198,7 @@

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

A few things have changed here: