orderly2 :: orderly_run ( "example" , root = path_root )
-## ℹ Starting packet 'example ' `20231019-174014-d69e076b` at 2023-10-19 17:40:14.845538
+## ℹ Starting packet 'example ' `20231120-112053-5018f38e` at 2023-11-20 11:20:53.317514
## > example.db::query(sql = "SELECT * FROM mtcars WHERE cyl == 4", as = "dat")
## > orderly2::orderly_artefact("Summary of data", "data.rds")
## > saveRDS(summary(dat), "data.rds")
## ✔ Finished running orderly.R
-## ℹ Finished 20231019-174014-d69e076b at 2023-10-19 17:40:15.00709 (0.1615522 secs)
-## [1] "20231019-174014-d69e076b"
+## ℹ Finished 20231120-112053-5018f38e at 2023-11-20 11:20:53.416759 (0.09924531 secs)
+## [1] "20231120-112053-5018f38e"
@@ -476,7 +476,7 @@
subsequent calls will not display the warning:
-
## ℹ Starting packet 'data ' `20231019-174026-0244e518` at 2023-10-19 17:40:26.014571
+
## ℹ Starting packet 'data ' `20231120-112100-59a385cc` at 2023-11-20 11:21:00.353258
## > orderly2::orderly_artefact("Final data", "data.rds")
## > saveRDS(mtcars, "data.rds")
## ✔ Finished running orderly.R
-
## ℹ Finished 20231019-174026-0244e518 at 2023-10-19 17:40:26.052328 (0.03775716 secs)
-
## [1] "20231019-174026-0244e518"
+
## ℹ Finished 20231120-112100-59a385cc at 2023-11-20 11:21:00.375651 (0.02239323 secs)
+
## [1] "20231120-112100-59a385cc"
The rest of this section discusses how you might permanently fix the
issue.
diff --git a/pkgdown.yml b/pkgdown.yml
index 6c0d55ac..41603022 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -11,7 +11,7 @@ articles:
plugins: plugins.html
query: query.html
troubleshooting: troubleshooting.html
-last_built: 2023-10-19T17:39Z
+last_built: 2023-11-20T11:20Z
urls:
reference: https://mrc-ide.github.io/orderly2/reference
article: https://mrc-ide.github.io/orderly2/articles
diff --git a/reference/orderly_cleanup.html b/reference/orderly_cleanup.html
index f7dd4ba9..6118b7aa 100644
--- a/reference/orderly_cleanup.html
+++ b/reference/orderly_cleanup.html
@@ -150,24 +150,24 @@
Notes for user of orderly1Examples
# Create a simple example:
path <- orderly2 :: orderly_example ( "default" )
-#> ✔ Created orderly root at '/tmp/RtmpD3H7Zj/file18d78bd15f9'
+#> ✔ Created orderly root at '/tmp/Rtmpsi6m8X/file1a204c97013f'
# We simulate running a packet interactively by using 'source';
# you might have run this line-by-line, or with the "Source"
# button in Rstudio.
source ( file.path ( path , "src/data/orderly.R" ) , chdir = TRUE )
-#> Warning: cannot open file '/tmp/RtmpD3H7Zj/file18d78bd15f9/src/data/orderly.R': No such file or directory
+#> Warning: cannot open file '/tmp/Rtmpsi6m8X/file1a204c97013f/src/data/orderly.R': No such file or directory
#> Error in file(filename, "r", encoding = encoding): cannot open the connection
# Having run this, the output of the report is present in the
# source directory:
fs :: dir_tree ( path )
-#> Error: [ENOENT] Failed to search directory '/tmp/RtmpD3H7Zj/file18d78bd15f9': no such file or directory
+#> Error: [ENOENT] Failed to search directory '/tmp/Rtmpsi6m8X/file1a204c97013f': no such file or directory
# We can detect what might want cleaning up by running
# "orderly_cleanup_status":
orderly2 :: orderly_cleanup_status ( "data" , root = path )
-#> Error: Directory does not exist: '/tmp/RtmpD3H7Zj/file18d78bd15f9'
+#> Error: Directory does not exist: '/tmp/Rtmpsi6m8X/file1a204c97013f'
# Soon this will print more nicely to the screen, but for now you
# can see that the status of "data.rds" is "derived", which means
@@ -176,7 +176,7 @@ Examples
# Do the actual deletion:
orderly2 :: orderly_cleanup ( "data" , root = path )
-#> Error: Directory does not exist: '/tmp/RtmpD3H7Zj/file18d78bd15f9'
+#> Error: Directory does not exist: '/tmp/Rtmpsi6m8X/file1a204c97013f'
On this page
diff --git a/reference/orderly_config.html b/reference/orderly_config.html
index 97238c32..8bd49944 100644
--- a/reference/orderly_config.html
+++ b/reference/orderly_config.html
@@ -123,7 +123,7 @@ Examples# A default configuration in a new temporary directory
path <- withr :: local_tempdir ( )
orderly2 :: orderly_init ( path )
-#> ✔ Created orderly root at '/tmp/RtmpD3H7Zj/file18d77805949d'
+#> ✔ Created orderly root at '/tmp/Rtmpsi6m8X/file1a20284d502'
orderly2 :: orderly_config ( path )
#> $core
#> $core$path_archive
diff --git a/reference/orderly_config_set.html b/reference/orderly_config_set.html
index dab757c7..fad7dea8 100644
--- a/reference/orderly_config_set.html
+++ b/reference/orderly_config_set.html
@@ -128,9 +128,9 @@ Examples# saves output within the "archive" directory:
path <- withr :: local_tempdir ( )
orderly2 :: orderly_init ( path )
-#> ✔ Created orderly root at '/tmp/RtmpD3H7Zj/file18d73e87175d'
+#> ✔ Created orderly root at '/tmp/Rtmpsi6m8X/file1a202ad54caf'
fs :: dir_tree ( path , all = TRUE )
-#> /tmp/RtmpD3H7Zj/file18d73e87175d
+#> /tmp/Rtmpsi6m8X/file1a202ad54caf
#> ├── .outpack
#> │ ├── config.json
#> │ ├── location
@@ -142,7 +142,7 @@ Examples core.path_archive = NULL ,
root = path )
fs :: dir_tree ( path , all = TRUE )
-#> /tmp/RtmpD3H7Zj/file18d73e87175d
+#> /tmp/Rtmpsi6m8X/file1a202ad54caf
#> ├── .outpack
#> │ ├── config.json
#> │ ├── files
diff --git a/reference/orderly_example.html b/reference/orderly_example.html
index 29c620a1..20ed2482 100644
--- a/reference/orderly_example.html
+++ b/reference/orderly_example.html
@@ -102,9 +102,9 @@ Value
Examples
path <- orderly2 :: orderly_example ( "default" )
-#> ✔ Created orderly root at '/tmp/RtmpD3H7Zj/file18d73ac80ebb'
+#> ✔ Created orderly root at '/tmp/Rtmpsi6m8X/file1a204a7f7f60'
orderly2 :: orderly_list_src ( root = path )
-#> Error: Directory does not exist: '/tmp/RtmpD3H7Zj/file18d73ac80ebb'
+#> Error: Directory does not exist: '/tmp/Rtmpsi6m8X/file1a204a7f7f60'
On this page
diff --git a/reference/orderly_init.html b/reference/orderly_init.html
index d4916887..96b73e58 100644
--- a/reference/orderly_init.html
+++ b/reference/orderly_init.html
@@ -77,7 +77,7 @@
Usage
On this page
diff --git a/reference/orderly_run.html b/reference/orderly_run.html
index 40bdad43..77eec6b3 100644
--- a/reference/orderly_run.html
+++ b/reference/orderly_run.html
@@ -249,19 +249,19 @@ Running with a so
Examples
# Create a simple example:
path <- orderly2 :: orderly_example ( "default" )
-#> ✔ Created orderly root at '/tmp/RtmpD3H7Zj/file18d75951b14e'
+#> ✔ Created orderly root at '/tmp/Rtmpsi6m8X/file1a2069e9a975'
# Run the 'data' task:
orderly2 :: orderly_run ( "data" , root = path )
-#> Error: Directory does not exist: '/tmp/RtmpD3H7Zj/file18d75951b14e'
+#> Error: Directory does not exist: '/tmp/Rtmpsi6m8X/file1a2069e9a975'
# After running, a finished packet appears in the archive:
fs :: dir_tree ( path )
-#> Error: [ENOENT] Failed to search directory '/tmp/RtmpD3H7Zj/file18d75951b14e': no such file or directory
+#> Error: [ENOENT] Failed to search directory '/tmp/Rtmpsi6m8X/file1a2069e9a975': no such file or directory
# and we can query the metadata:
orderly2 :: orderly_metadata_extract ( name = "data" , root = path )
-#> Error: Directory does not exist: '/tmp/RtmpD3H7Zj/file18d75951b14e'
+#> Error: Directory does not exist: '/tmp/Rtmpsi6m8X/file1a2069e9a975'
On this page
diff --git a/search.json b/search.json
index c8de97fb..8df59470 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"https://mrc-ide.github.io/orderly2/articles/collaboration.html","id":"type-of-location","dir":"Articles","previous_headings":"","what":"Type of location","title":"Collaborative analysis","text":"orderly2 supports two types locations default: path: orderly2 working copy can find filesystem. Note copy people can see (example network share, cloud-synced file system Dropbox OneDrive) http: require running HTTP API, either via outpack_server packit location system somewhat extensible, details subject change. outpack.sharepoint using SharePoint, may write backends later. documentation behave regardless location stored mechanism transport, can focus instead workflows.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/collaboration.html","id":"an-example","dir":"Articles","previous_headings":"","what":"An example","title":"Collaborative analysis","text":"Suppose two researchers, Alice Bob, collaborating piece analysis. purposes example (find common situation practice) share source tree analysis git. Alice Bob clone repo onto machines, using favourite git client (terminal git, via GitHub desktop, gert) moment, including hidden files (except .git), Alice sees: point, cloning Alice .outpack directory (see ) Alice needs run orderly::orderly_init() first: plan work Bob, sharing results shared server, Alice adds orderly2 configuration orderly2::orderly_location_add(): done, can run analysis: Perhaps takes several goes Alice happy analysis, point something ready share. can “push” final packet onto server: Now, consider Bob. also needs source code cloned, orderly initialised, server added: (, Bob also used name server refer shared server, used anything; similar git’s use origin.) Bob can now query packets available server: seen new “data” packet , can pull locally (TODO: mrc-4414 makes nicer): Now Bob position develop packet Alice ran (20231019-173947-c248c33f)","code":"fs::dir_tree(\".\", all = TRUE, glob = \".git\", invert = TRUE) ## . ## ├── orderly_config.yml ## └── src ## └── data ## └── orderly.R orderly2::orderly_list_src() ## [1] \"data\" orderly2::orderly_init(\".\") ## ✔ Created orderly root at '.' ## ✔ Wrote '.gitignore' orderly2::orderly_list_src() ## [1] \"data\" orderly2::orderly_location_add( \"server\", \"http\", list(url = \"http://orderly.example.com\")) id <- orderly2::orderly_run(\"data\") ## ℹ Starting packet 'data' `20231019-173947-c248c33f` at 2023-10-19 17:39:47.769593 ## > orderly2::orderly_artefact(\"Final data\", \"data.rds\") ## > saveRDS(mtcars, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231019-173947-c248c33f at 2023-10-19 17:39:47.873354 (0.103761 secs) orderly2::orderly_location_push(id, \"server\") orderly2::orderly_init(\".\") ## ✔ Created orderly root at '.' ## ✔ Wrote '.gitignore' orderly2::orderly_location_add( \"server\", \"http\", list(url = \"http://orderly.example.com\")) orderly2::orderly_metadata_extract( name = \"data\", options = list(allow_remote = TRUE, pull_metadata = TRUE)) ## id name parameters ## 1 20231019-173947-c248c33f data 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 [6ms] ## ✔ Fetched 2 files (1.3 kB) from 'server' in 36ms. ##"},{"path":"https://mrc-ide.github.io/orderly2/articles/collaboration.html","id":"possible-working-patterns","dir":"Articles","previous_headings":"","what":"Possible working patterns","title":"Collaborative analysis","text":"seen several broad patterns distributing packets. Central server, push allowed: case ; flexible requires everyone relaxed packets created ultimately trusting colleagues exercising good environment hygiene. Just rules enforced computer though, doesn’t mean might ideas within group can push. may useful push HPC system running computationally demanding tasks . Central server, final copy run : case, Alice Bob can run things server, “canonical” copies, nothing pushed server. Reports can run server ssh-ing onto server running packets manually (TODO: mrc-4412) using web interface (possible OrderlyWeb possible packit). approach works well primary goal confidence packets everyone works dependencies created “clean” environment unexpected global dependencies. web version, can also enforce things like running default branch. Alice Bob end collection packets local archives mix canonical ones (server) locally-created ones, local ones always dead end never get shared anyone. result, Alice Bob may delete archive directories without great concern. running packets, make sure packet run similar way packet run server, Bob may want ensure dependencies found server considered. , can create search options pass orderly2::orderly_run running report. developing, Bob may find passing orderly2::orderly_interactive_set_search_options() helpful mean calls orderly2::orderly_description() use packets server. Staging production servers: might set multiple servers, one staging, one production. staging servers never source truth might (might ) allow people push , less strict rules gets run (perhaps allowing running packets feature branch). setting, users end packets created locally, staging machines production server local archive. staging server probably end mix packets packets production. approach specifying search options useful choosing included final packet.","code":"search_options <- orderly2::orderly_search_options(location = \"server\")"},{"path":"https://mrc-ide.github.io/orderly2/articles/collaboration.html","id":"pulling-complete-trees-or-not","dir":"Articles","previous_headings":"","what":"Pulling complete trees, or not","title":"Collaborative analysis","text":"pull packets server (orderly2::orderly_location_pull_packet()), depending settings either end just packet request, packet plus recursive dependencies. controlled configuration option core.require_complete_tree, FALSE default; suitable users, servers set core.require_complete_tree = TRUE. situations , users never holding canonical source packets - matter don’t dependencies. hold metadata packets (, recursively) download dependencies later wanted inspect . Typically though, just extra space used disk. push packet server, always pushes complete tree.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/collaboration.html","id":"moving-as-little-data-as-possible","dir":"Articles","previous_headings":"","what":"Moving as little data as possible","title":"Collaborative analysis","text":"pulling packets, first user pulls metadata server. orderly2::orderly_location_metadata_pull run, metadata server updated client (mrc-4444 make lazier). now know everything server holds, hashes files contained packet. likely already know files within packet requested, client first looks see exist within archive, verifying changed. requests server files resolve locally. recursive pull (core.require_complete_tree = TRUE) look union files set packets currently missing archive. frequently much less full set files within packets. algorithm similar push: look full dependency chain target packet find file ids ask server yet know unknown subset get union file hashes ask server subset files yet know push files - done one time present done simultaneously async requests future files sever upload missing metadata, chronological order server verifies packet metadata dependencies referenced files multi-step process means avoid copying data already known , well avoiding moving data multiple times. also means process pushing (pulling) interrupted can safely resumed state always consistent.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/collaboration.html","id":"interaction-between-source-tree-and--outpack","dir":"Articles","previous_headings":"","what":"Interaction between source tree and .outpack","title":"Collaborative analysis","text":"important .outpack directory shared via git; warn now, can use orderly2::ordery_gitignore_update() automatically create suitable .gitignore file prevent accidentally committed. However, Alice Bob starting new machine : clone source repository run orderly2::orderly_init() within directory run orderly2 commands normal Without running orderly2::orderly_init(), get error prompting initialise repo. requirement different repositories share configuration options passed orderly2::orderly_init(); can enable disable file store different sets locations enabled, depending workflows. means , practice, association convention set related orderly2 locations source tree can orderly2 repository points locations refer different source trees!","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/dependencies.html","id":"using-dependencies","dir":"Articles","previous_headings":"","what":"Using dependencies","title":"Dependencies between packets","text":", show practically use dependencies common scenarios increasing complexity. code examples purposefully -simple order keep presentation straightforward, see end document discussion complex pieces code might “optimally” .","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/dependencies.html","id":"basic-use","dir":"Articles","previous_headings":"Using dependencies","what":"Basic use","title":"Dependencies between packets","text":"primary mechanism using dependencies call orderly2::orderly_dependency() within orderly.R script; finds suitable completed packet copies files found within packet current report. src/analysis/orderly.R contains: , ’ve used orderly2::orderly_dependency() pull file data.rds recent version (latest()) data packet, ’ve used file normal make plot, ’ve saved analysis.png (similar example vignette(\"introduction\"), get us started). look metadata packet created analysis report, can see used 20231019-173952-4c55b155 dependency: (indeed , one copy data packet pick ).","code":"## src ## ├── analysis ## │ └── orderly.R ## └── data ## ├── data.csv ## └── orderly.R orderly2::orderly_dependency(\"data\", \"latest()\", \"data.rds\") d <- readRDS(\"data.rds\") png(\"analysis.png\") plot(y ~ x, d) dev.off() id1 <- orderly2::orderly_run(\"data\", root = path) ## ℹ Starting packet 'data' `20231019-173952-4c55b155` at 2023-10-19 17:39:52.305603 ## > d <- read.csv(\"data.csv\") ## > d$z <- resid(lm(y ~ x, d)) ## > saveRDS(d, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231019-173952-4c55b155 at 2023-10-19 17:39:52.373914 (0.06831145 secs) id2 <- orderly2::orderly_run(\"analysis\", root = path) ## ℹ Starting packet 'analysis' `20231019-173952-68545508` at 2023-10-19 17:39:52.413128 ## > orderly2::orderly_dependency(\"data\", \"latest()\", \"data.rds\") ## ℹ Depending on data @ `20231019-173952-4c55b155` (via latest(name == \"data\")) ## > d <- readRDS(\"data.rds\") ## > png(\"analysis.png\") ## > plot(y ~ x, d) ## > dev.off() ## agg_png ## 2 ## ✔ Finished running orderly.R ## ℹ Finished 20231019-173952-68545508 at 2023-10-19 17:39:52.540918 (0.1277897 secs) orderly2::orderly_metadata(id2, root = path)$depends ## packet query files ## 1 20231019-173952-4c55b155 latest(name == \"data\") data.rds...."},{"path":"https://mrc-ide.github.io/orderly2/articles/dependencies.html","id":"filtering-candidates-by-parameters","dir":"Articles","previous_headings":"Using dependencies","what":"Filtering candidates by parameters","title":"Dependencies between packets","text":"example, query simple — recently created packet name data. One common pattern see analysis might parameter (example country name) downstream analysis might share parameter want pull data country. src/data/orderly.R containing: can run several values cyl: follow-analysis contains: query latest(parameter:cyl == :cyl) says “find recent packet ’s parameter”cyl” (parameter:cyl) parameter currently running report (:cyl).","code":"## src ## ├── analysis ## │ └── orderly.R ## └── data ## └── orderly.R orderly2::orderly_parameters(cyl = NULL) d <- mtcars[mtcars$cyl == cyl, ] saveRDS(d, \"data.rds\") orderly2::orderly_run(\"data\", list(cyl = 4), root = path) ## ℹ Starting packet 'data' `20231019-173953-16ad55ed` at 2023-10-19 17:39:53.094074 ## ℹ Parameters: ## • cyl: 4 ## > orderly2::orderly_parameters(cyl = NULL) ## > d <- mtcars[mtcars$cyl == cyl, ] ## > saveRDS(d, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231019-173953-16ad55ed at 2023-10-19 17:39:53.150804 (0.05673003 secs) ## [1] \"20231019-173953-16ad55ed\" orderly2::orderly_run(\"data\", list(cyl = 6), root = path) ## ℹ Starting packet 'data' `20231019-173953-2e1acc3a` at 2023-10-19 17:39:53.185202 ## ℹ Parameters: ## • cyl: 6 ## > orderly2::orderly_parameters(cyl = NULL) ## > d <- mtcars[mtcars$cyl == cyl, ] ## > saveRDS(d, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231019-173953-2e1acc3a at 2023-10-19 17:39:53.248489 (0.06328678 secs) ## [1] \"20231019-173953-2e1acc3a\" orderly2::orderly_run(\"data\", list(cyl = 8), root = path) ## ℹ Starting packet 'data' `20231019-173953-4800b63d` at 2023-10-19 17:39:53.286784 ## ℹ Parameters: ## • cyl: 8 ## > orderly2::orderly_parameters(cyl = NULL) ## > d <- mtcars[mtcars$cyl == cyl, ] ## > saveRDS(d, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231019-173953-4800b63d at 2023-10-19 17:39:53.340405 (0.05362129 secs) ## [1] \"20231019-173953-4800b63d\" orderly2::orderly_parameters(cyl = NULL) orderly2::orderly_dependency( \"data\", \"latest(parameter:cyl == this:cyl)\", \"data.rds\") d <- readRDS(\"data.rds\") png(\"analysis.png\") plot(mpg ~ disp, d) dev.off() orderly2::orderly_run(\"analysis\", list(cyl = 4), root = path) ## ℹ Starting packet 'analysis' `20231019-173953-90f8c7ac` at 2023-10-19 17:39:53.572129 ## ℹ Parameters: ## • cyl: 4 ## > orderly2::orderly_parameters(cyl = NULL) ## > orderly2::orderly_dependency( ## + \"data\", ## + \"latest(parameter:cyl == this:cyl)\", ## + \"data.rds\") ## ℹ Depending on data @ `20231019-173953-16ad55ed` (via latest(parameter:cyl == this:cyl && name == \"data\")) ## > d <- readRDS(\"data.rds\") ## > png(\"analysis.png\") ## > plot(mpg ~ disp, d) ## > dev.off() ## agg_png ## 2 ## ✔ Finished running orderly.R ## ℹ Finished 20231019-173953-90f8c7ac at 2023-10-19 17:39:53.670103 (0.0979743 secs) ## [1] \"20231019-173953-90f8c7ac\""},{"path":"https://mrc-ide.github.io/orderly2/articles/dependencies.html","id":"interpreting-errors","dir":"Articles","previous_headings":"Using dependencies","what":"Interpreting errors","title":"Dependencies between packets","text":"query fails resolve candidate error: error message tries fairly self explanatory; failed find packet satisfies querylatest(parameter:cyl == :cyl && name == \"data\"); note report name data become part query, two conditions matched . error suggests running rlang::last_error()$explanation information, can : orderly_query_explain object, tries come reasons query might matched; ’ll expand future let us know might like see. tells query can decomposed two subqueries (match parameter cyl 9000), matched packets B (match packet name data), matched 3 packets. subquery matched packets pairs don’t try guide towards problematic pairs. can also ask orderly2 explain query : save object can explore detail: (worked rlang::last_error()$explanation$parts$). can also use orderly2::orderly_metadata_extract work values might looked :","code":"orderly2::orderly_run(\"analysis\", list(cyl = 9000), root = path) ## ℹ Starting packet 'analysis' `20231019-173953-cc39b8d3` at 2023-10-19 17:39:53.802991 ## ℹ Parameters: ## • cyl: 9000 ## > orderly2::orderly_parameters(cyl = NULL) ## > orderly2::orderly_dependency( ## + \"data\", ## + \"latest(parameter:cyl == this:cyl)\", ## + \"data.rds\") ## ✖ Error running orderly.R ## ℹ Finished 20231019-173953-cc39b8d3 at 2023-10-19 17:39:53.913578 (0.1105866 secs) ## Error in `orderly2::orderly_run()`: ## ! Failed to run report ## Caused by error in `outpack_packet_use_dependency()`: ## ! Failed to find packet for query 'latest(parameter:cyl == this:cyl && ## name == \"data\")' ## ℹ See 'rlang::last_error()$explanation' for details rlang::last_error()$explanation ## Evaluated query: 'latest(A && B)' and found 0 packets ## • A (parameter:cyl == this:cyl): 0 packets ## ## • B (name == \"data\"): 3 packets orderly2::orderly_query_explain( quote(latest(parameter:cyl == 9000)), name = \"data\", root = path) ## Evaluated query: 'latest(A && B)' and found 0 packets ## • A (parameter:cyl == 9000): 0 packets ## ## • B (name == \"data\"): 3 packets explanation <- orderly2::orderly_query_explain( quote(latest(parameter:cyl == 9000)), name = \"data\", root = path) explanation$parts$B ## $name ## [1] \"B\" ## ## $str ## [1] \"name == \\\"data\\\"\" ## ## $expr ## name == \"data\" ## ## $n ## [1] 3 ## ## $found ## [1] \"20231019-173953-16ad55ed\" \"20231019-173953-2e1acc3a\" ## [3] \"20231019-173953-4800b63d\" orderly2::orderly_metadata_extract( name = \"data\", extract = c(cyl = \"parameters.cyl is number\"), root = path) ## id cyl ## 1 20231019-173953-16ad55ed 4 ## 2 20231019-173953-2e1acc3a 6 ## 3 20231019-173953-4800b63d 8"},{"path":"https://mrc-ide.github.io/orderly2/articles/dependencies.html","id":"filtering-candidates-in-other-ways","dir":"Articles","previous_headings":"Using dependencies","what":"Filtering candidates in other ways","title":"Dependencies between packets","text":"saw two types filtering candidates: latest() selected recent packet latest(parameter:cyl == :cyl) found packet whose parameter matched one parameters. used latest(parameter:cyl == 4) hard code specific parameter value, used latest(parameter:cyl == environment:cyl) match whatever value cyl took evaluating environment. Instead query, can provide single id (e.g, 20231019-173953-90f8c7ac), mean even new copies data packet created, dependency always resolve value. can chain together logical operations && (sides must true) || (either side must true), group conditions parentheses. addition ==, usual complement comparison operators work. might complex queries like practice people queries series restrictions &&.","code":"latest((parameter:x == 1 || parameter:x == 2) && parameter:y > 10)"},{"path":"https://mrc-ide.github.io/orderly2/articles/dependencies.html","id":"computing-dependencies-and-using-many-dependencies-at-once","dir":"Articles","previous_headings":"Using dependencies","what":"Computing dependencies and using many dependencies at once","title":"Dependencies between packets","text":"One common pattern map-reduce pattern set orderly reports. , set packets created vector parameters, perhaps chain different reports parameter, combined together. parameter p takes values “x”, “y” “z”, might look like: , D want combine three copies C packet, one p “x”, “y” “z”. Especially three values hard coded, might just write Note call vary second argument select different parameter value, third argument naming destination file different name (end three files data/). can write loop: , second argument use environment:p fetch value p calling environment - looping value take three values. name third argument, use special interpolation format ${p} substitute value p build filename.","code":"B(p = \"x\") -- C(p = \"x\") / \\ A - B(p = \"y\") -- C(p = \"y\") - D \\ / B(p = \"z\") -- C(p = \"z\") orderly2::orderly_dependency(\"C\", quote(latest(parameter:p == \"x\")), c(\"data/x.rds\" = \"result.rds\")) orderly2::orderly_dependency(\"C\", quote(latest(parameter:p == \"y\")), c(\"data/y.rds\" = \"result.rds\")) orderly2::orderly_dependency(\"C\", quote(latest(parameter:p == \"z\")), c(\"data/z.rds\" = \"result.rds\")) for (p in c(\"x\", \"y\", \"z\")) { orderly2::orderly_dependency(\"C\", quote(latest(parameter:p == environment:p)), c(\"data/${p}.rds\" = \"result.rds\")) }"},{"path":"https://mrc-ide.github.io/orderly2/articles/dependencies.html","id":"how-dependencies-interact-with-locations","dir":"Articles","previous_headings":"","what":"How dependencies interact with locations","title":"Dependencies between packets","text":"default, packet unpacked local archive considered candidate inclusion orderly_dependency(). always want. locations selected, packets within considered candidates can controlled search_options argument orderly2::orderly_run (note argument orderly_run(), orderly_dependency() effect controlled runner report, writer report). three components affect packets selected location: character vector locations, matching location names. packets can found locations considered. mix locally created packets well ones people can see, specifying location = \"server\" limit packets available server, means end dependencies colleagues also get. allow_remote: controls willing download files location order satisfy dependency. TRUE, run report, might download files recent packets available location locally. pull_metadata: effect allow_remote also TRUE; causes metadata refreshed dependency resolution. discussion details ?orderly_run","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/dependencies.html","id":"other-points","dir":"Articles","previous_headings":"","what":"Other points","title":"Dependencies between packets","text":"used systems like targets, easy make reports smaller need . ’s real need make small, picking right size challenge. small, ’ll end writing lot code orchestrate running different reports pulling things together. ’ll end spending lot time whether things “date” one another really group things always wants run together. ’re big might end work want , order make change part piece analysis must run whole thing .","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"creating-an-empty-orderly-repository","dir":"Articles","previous_headings":"","what":"Creating an empty orderly repository","title":"Introduction to orderly2","text":"first step initialise empty orderly2 repository. orderly2 repository directory file orderly_config.yml within , since version 2 also directory .outpack/. Files within .outpack/ directory never directly modified users directory excluded version control (see orderly2::orderly_gitignore_update). Create orderly2 repository calling orderly2::orderly_init(): creates files: step performed completely empty directory, otherwise error thrown. Later, re-initialise orderly2 repository cloning new machine, working others; discussed vignette(\"collaboration\")l. orderly_config.yml file contains little default:","code":"path <- tempfile() # we'll use a temporary directory here orderly2::orderly_init(path) ## ✔ Created orderly root at '/tmp/RtmpvVHGt5/file1c547ce2e905' ## . ## ├── .outpack ## │ ├── config.json ## │ ├── location ## │ └── metadata ## └── orderly_config.yml minimum_orderly_version: \"1.99.0\""},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"creating-your-first-orderly-report","dir":"Articles","previous_headings":"","what":"Creating your first orderly report","title":"Introduction to orderly2","text":"orderly report directory src/ containing file orderly.R. file may special commands , now ’ll create one simple possible; ’ll create random data save disk. seems silly, imagine standing something like: downloading file external site resource running simulation saving output fitting model data merging set files together create final data set directory structure (ignoring .outpack) looks like: src/incoming_data/orderly.R contains: run report create new packet, use orderly2::orderly_run(): id created new identifier packet unique among packets (within reason) chronologically sortable. packet id sorts another packet’s id started packet. run report, directory structure looks like: things changed : file created ran report (data.rds; see script ) log happened report run packet created orderly.R data.csv, original input come source tree empty directory draft/incoming_data created orderly ran report first place addition, quite files changed within .outpack directory, covered . ’s ! Notice initial script just plain R script, can develop interactively within src/incoming_data directory. Note however, paths referred within relative src/incoming_data orderly repository root. important reports see world relative orderly.R file. created, can refer report id pull files wherever need , context another orderly report just copy desktop email someone. example, copy file data.rds created location outside orderly’s control copies data.rds new temporary directory dest name final.rds. uses orderly2’s outpack_ functions, designed interact outpack archives regardless created (orderly2 program creates outpack archives). Typically lower-level orderly_ functions.","code":"## . ## ├── orderly_config.yml ## └── src ## └── incoming_data ## ├── data.csv ## └── orderly.R d <- read.csv(\"data.csv\") d$z <- resid(lm(y ~ x, d)) saveRDS(d, \"data.rds\") id <- orderly2::orderly_run(\"incoming_data\", root = path) ## ℹ Starting packet 'incoming_data' `20231019-173958-d8042db4` at 2023-10-19 17:39:58.851746 ## > d <- read.csv(\"data.csv\") ## > d$z <- resid(lm(y ~ x, d)) ## > saveRDS(d, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231019-173958-d8042db4 at 2023-10-19 17:39:58.963263 (0.111517 secs) id ## [1] \"20231019-173958-d8042db4\" ## . ## ├── archive ## │ └── incoming_data ## │ └── 20231019-173958-d8042db4 ## │ ├── data.csv ## │ ├── data.rds ## │ └── orderly.R ## ├── draft ## │ └── incoming_data ## ├── orderly_config.yml ## └── src ## └── incoming_data ## ├── data.csv ## └── orderly.R dest <- tempfile() fs::dir_create(dest) orderly2::orderly_copy_files(id, files = c(\"final.rds\" = \"data.rds\"), dest = dest, root = path)"},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"depending-on-packets-from-another-report","dir":"Articles","previous_headings":"","what":"Depending on packets from another report","title":"Introduction to orderly2","text":"Creating new dataset mostly useful someone else can use . introduce first special orderly commands can use orderly.R src/ directory now looks like: src/analysis/orderly.R contains: , ’ve used orderly2::orderly_dependency() pull file data.rds recent version (latest()) data packet filename incoming.rds, ’ve used file normal make plot, ’ve saved analysis.png. can run just , using orderly2::orderly_run(): information dependencies, see vignette(\"dependencies\").","code":"## src ## ├── analysis ## │ └── orderly.R ## └── incoming_data ## ├── data.csv ## └── orderly.R orderly2::orderly_dependency(\"incoming_data\", \"latest()\", c(\"incoming.rds\" = \"data.rds\")) d <- readRDS(\"incoming.rds\") png(\"analysis.png\") plot(y ~ x, d) dev.off() id <- orderly2::orderly_run(\"analysis\", root = path) ## ℹ Starting packet 'analysis' `20231019-173959-9c2c2550` at 2023-10-19 17:39:59.615243 ## > orderly2::orderly_dependency(\"incoming_data\", \"latest()\", ## + c(\"incoming.rds\" = \"data.rds\")) ## ℹ Depending on incoming_data @ `20231019-173958-d8042db4` (via latest(name == \"incoming_data\")) ## > d <- readRDS(\"incoming.rds\") ## > png(\"analysis.png\") ## > plot(y ~ x, d) ## > dev.off() ## agg_png ## 2 ## ✔ Finished running orderly.R ## ℹ Finished 20231019-173959-9c2c2550 at 2023-10-19 17:39:59.751891 (0.1366477 secs)"},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"available-in-report-orderly-commands","dir":"Articles","previous_headings":"","what":"Available in-report orderly commands","title":"Introduction to orderly2","text":"function orderly2::orderly_dependency() designed operate packet runs. functions act adding metadata final packet, perhaps copying files directory. orderly2::orderly_description(): Provide longer name description report; can reflected tooling uses orderly metadata much informative short name. orderly2::orderly_parameters(): Declares parameters can passed control behaviour report. Parameters key-value pairs simple data (booleans, numbers, strings) report can respond . can also used queries orderly2::orderly_dependency() find packets satisfy criteria. orderly2::orderly_resource(): Declares file resource; file input report, comes source directory. default, orderly treats files directory resource, can useful mark explicitly, necessary “strict mode” (see ). Files marked resource immutable may deleted modified. orderly2::orderly_shared_resource(): Copies file “shared resources” directory shared/, can data files source code located root orderly repository. can reasonable way sharing data commonly used code among several reports. orderly2::orderly_artefact(): Declares file (set files) created report, even run. makes easier check report behaves expected can allow reasoning related set reports without running . declaring something artefact (especially conjunction “strict mode”) also easier clean src directories used interactive development (see ). orderly2::orderly_dependency(): Copy files one packet packet runs, seen . orderly2::orderly_strict_mode(): Declares report run “strict mode” (see ). addition, also function orderly::orderly_run_info() can used running report returns information currently running report (id, resolved dependencies etc). Let’s add additional annotations previous reports: , ’ve added block special orderly commands; go anywhere, example files refer . strict mode enabled (see ) orderly2::orderly_resource calls must go files used made available point (see ).","code":"orderly2::orderly_strict_mode() orderly2::orderly_resource(\"data.csv\") orderly2::orderly_artefact(\"Processed data\", \"data.rds\") d <- read.csv(\"data.csv\") d$z <- resid(lm(y ~ x, d)) saveRDS(d, \"data.rds\") id <- orderly2::orderly_run(\"incoming_data\", root = path) ## ℹ Starting packet 'incoming_data' `20231019-174000-0c9fbed9` at 2023-10-19 17:40:00.052451 ## > orderly2::orderly_strict_mode() ## > orderly2::orderly_resource(\"data.csv\") ## > orderly2::orderly_artefact(\"Processed data\", \"data.rds\") ## > d <- read.csv(\"data.csv\") ## > d$z <- resid(lm(y ~ x, d)) ## > saveRDS(d, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231019-174000-0c9fbed9 at 2023-10-19 17:40:00.101082 (0.04863071 secs)"},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"parameterised-reports","dir":"Articles","previous_headings":"","what":"Parameterised reports","title":"Introduction to orderly2","text":"Much flexibility comes orderly graph comes using parameterised reports; reports take set parameters change behaviour based parameters. Downstream reports can depend parameterised report filter based suitable parameters. example, consider simple report generate samples based parameter: creates report single parameter n_samples default value 10. used define parameter default, defined multiple parameters can anything report switches value parameter: might read different URLs fetch different underlying data might fit different analysis might read different shared resources (see ) might depend different dependencies might produce different artefacts However, see parameters relatively heavyweight things try consistent set packets created report. report use control size generated data set. resulting file 15 rows, parameter passed affected report: can use parameters orderly’s search functions. example can find recent version packet running: can also pass parameter queries : can used within orderly2::orderly_dependency() (name == \"random\" part implied first name argument), example case report querying also parameters can use within query, using prefix. suppose downstream report simply uses n number samples might write: depend recent packet called random parameter n_samples value current report’s parameter n. See outpack query documentation much detail .","code":"orderly2::orderly_parameters(n_samples = 10) x <- seq_len(n_samples) d <- data.frame(x = x, y = x + rnorm(n_samples)) saveRDS(d, \"data.rds\") orderly2::orderly_parameters(n_samples = NULL) orderly2::orderly_parameters(n_samples = 10, distribution = \"normal\") id <- orderly2::orderly_run(\"random\", list(n_samples = 15), root = path) ## ℹ Starting packet 'random' `20231019-174000-688fe764` at 2023-10-19 17:40:00.413626 ## ℹ Parameters: ## • n_samples: 15 ## > orderly2::orderly_parameters(n_samples = 10) ## > x <- seq_len(n_samples) ## > d <- data.frame(x = x, y = x + rnorm(n_samples)) ## > saveRDS(d, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231019-174000-688fe764 at 2023-10-19 17:40:00.466906 (0.0532794 secs) orderly2::orderly_copy_files(id, files = c(\"random.rds\" = \"data.rds\"), dest = dest, root = path) readRDS(file.path(dest, \"random.rds\")) ## x y ## 1 1 0.5286538 ## 2 2 0.8601853 ## 3 3 2.6622628 ## 4 4 2.9869136 ## 5 5 5.8027453 ## 6 6 7.7430376 ## 7 7 5.4289777 ## 8 8 7.1717422 ## 9 9 10.0050024 ## 10 10 9.4716598 ## 11 11 10.8970688 ## 12 12 11.7288002 ## 13 13 11.6115539 ## 14 14 14.1733536 ## 15 15 15.8023363 orderly2::orderly_search('latest(name == \"random\")', root = path) ## [1] \"20231019-174000-688fe764\" orderly2::orderly_search('latest(name == \"random\" && parameter:n_samples > 10)', root = path) ## [1] \"20231019-174000-688fe764\" orderly2::orderly_dependency(\"random\", \"latest(parameter:n_samples > 10)\", c(\"randm.rds\" = \"data.rds\")) orderly2::orderly_dependency(\"random\", \"latest(parameter:n_samples == this:n)\", c(\"randm.rds\" = \"data.rds\"))"},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"shared-resources","dir":"Articles","previous_headings":"","what":"Shared resources","title":"Introduction to orderly2","text":"Sometimes useful share data different reports, example common source utilities don’t warrant package, common data. , create directory shared orderly root put files directories might want share. Suppose shared directory contains file data.csv: can write orderly report use_shared uses shared file, orderly.R containing: can run : resulting archive, file used shared directory present: general property orderly: tries save inputs alongside final results analysis, later can check see went analysis might changed versions.","code":"## . ## ├── archive ## │ ├── analysis ## │ │ └── 20231019-173959-9c2c2550 ## │ │ ├── analysis.png ## │ │ ├── incoming.rds ## │ │ └── orderly.R ## │ ├── incoming_data ## │ │ ├── 20231019-173958-d8042db4 ## │ │ │ ├── data.csv ## │ │ │ ├── data.rds ## │ │ │ └── orderly.R ## │ │ └── 20231019-174000-0c9fbed9 ## │ │ ├── data.csv ## │ │ ├── data.rds ## │ │ └── orderly.R ## │ └── random ## │ └── 20231019-174000-688fe764 ## │ ├── data.rds ## │ └── orderly.R ## ├── draft ## │ ├── analysis ## │ ├── incoming_data ## │ └── random ## ├── orderly_config.yml ## ├── shared ## │ └── data.csv ## └── src ## ├── analysis ## │ └── orderly.R ## ├── incoming_data ## │ ├── data.csv ## │ └── orderly.R ## └── random ## └── orderly.R orderly2::orderly_shared_resource(data.csv = \"data.csv\") orderly2::orderly_artefact(\"analysis\", \"analysis.png\") d <- read.csv(\"data.csv\") png(\"analysis.png\") plot(y ~ x, d) dev.off() id <- orderly2::orderly_run(\"use_shared\", root = path) ## ℹ Starting packet 'use_shared' `20231019-174001-249b652f` at 2023-10-19 17:40:01.148502 ## > orderly2::orderly_shared_resource(data.csv = \"data.csv\") ## > orderly2::orderly_artefact(\"analysis\", \"analysis.png\") ## > d <- read.csv(\"data.csv\") ## > png(\"analysis.png\") ## > plot(y ~ x, d) ## > dev.off() ## agg_png ## 2 ## ✔ Finished running orderly.R ## ℹ Finished 20231019-174001-249b652f at 2023-10-19 17:40:01.217931 (0.06942916 secs) ## archive/use_shared ## └── 20231019-174001-249b652f ## ├── analysis.png ## ├── data.csv ## └── orderly.R"},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"strict-mode","dir":"Articles","previous_headings":"","what":"Strict mode","title":"Introduction to orderly2","text":"previous version orderly (orderly1; see vignette(\"migrating\")) fussy input strictly declared report run, clear really required order run something. version 2 relaxed default, can opt old behaviours checks adding anywhere within orderly.R script (conventionally top). may make granular future, adding : copy files source directory (src//) draft directory report runs (draft//) declared orderly2::orderly_resource; leaves behind extra files left development warn end running packet files found part artefact Using strict mode also helps orderly2 clean src/ directory effectively interactive development (see next section).","code":"orderly2::orderly_strict_mode()"},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"interactive-development","dir":"Articles","previous_headings":"","what":"Interactive development","title":"Introduction to orderly2","text":"Set working directory src/ orderly script fully executable (e.g., source Rstudio’s Source button, R’s source() function). Dependencies copied needed. , mix files within source directory. recommend per-source-directory .gitignore keep files version control (see ). soon implement support cleaning generated files directory. example, suppose interactively run incoming_data/orderly.R script, leave behind generated files. can report orderly2::orderly_cleanup_status: files unknown orderly tell prompt tell explicitly. can clean generated files running (suggested message): dry_run = TRUE argument can pass want see deleted without using status function. can also keep files git using orderly2::orderly_gitignore_update function: creates (updates) .gitignore file within report generated files included git. already accidentally committed gitignore real effect git surgery, see git manuals handy, profane, guide.","code":"orderly2::orderly_cleanup_status(\"incoming_data\", root = path) ## ✖ incoming_data is not clean: ## ℹ 1 file can be deleted by running 'orderly2::orderly_cleanup(\"incoming_data\")': ## • data.rds orderly2::orderly_cleanup(\"incoming_data\", root = path) ## ℹ Deleting 1 file from 'incoming_data': ## • data.rds orderly2::orderly_gitignore_update(\"incoming_data\", root = path) ## ✔ Wrote 'src/incoming_data/.gitignore'"},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"deleting-things-from-the-archive","dir":"Articles","previous_headings":"","what":"Deleting things from the archive","title":"Introduction to orderly2","text":"delete packets archive/ directory puts orderly2 inconsistent state metadata store. Sometimes matter (e.g., delete old copies never candidates inclusion orderly2::orderly_dependency never notice). However, delete recent copy packet try depend , get error. moment, two copies incoming_data task: run analysis task, pull recent version (20231019-174000-0c9fbed9). However, deleted manually (e.g., save space accidentally) corrupted (e.g., opening output Excel letting save changes) able included, running analysis fail: error tries fairly informative, telling us failed copying files 20231019-174000-0c9fbed9 found packet corrupt, file data.rds found archive. also suggests fix; can tell orderly2 20231019-174000-0c9fbed9 “orphaned” considered inclusion look dependencies. can carry suggestion just validate packet running can validate packets : option core.require_complete_tree enabled, process also look packets used now-deleted packet orphan , longer complete tree includes . want remove references orphaned packets, can use orderly2::orderly_prune_orphans() remove entirely:","code":"orderly2::orderly_metadata_extract( name = \"incoming_data\", extract = c(time = \"time.start\"), root = path) ## id time ## 1 20231019-173958-d8042db4 2023-10-19 17:39:58 ## 2 20231019-174000-0c9fbed9 2023-10-19 17:40:00 orderly2::orderly_run(\"analysis\", root = path) ## ℹ Starting packet 'analysis' `20231019-174002-1e23fae6` at 2023-10-19 17:40:02.122926 ## > orderly2::orderly_dependency(\"incoming_data\", \"latest()\", ## + c(\"incoming.rds\" = \"data.rds\")) ## ✖ Error running orderly.R ## ℹ Finished 20231019-174002-1e23fae6 at 2023-10-19 17:40:02.265222 (0.1422958 secs) ## Error in `orderly2::orderly_run()`: ## ! Failed to run report ## Caused by error in `orderly_copy_files()`: ## ! Unable to copy files, due to deleted packet 20231019-174000-0c9fbed9 ## ℹ Consider 'orderly2::orderly_validate_archive(\"20231019-174000-0c9fbed9\", ## action = \"orphan\")' to remove this packet from consideration ## Caused by error: ## ! File not found in archive ## ✖ data.rds orderly2::orderly_validate_archive(\"20231019-174000-0c9fbed9\", action = \"orphan\") orderly2::orderly_validate_archive(action = \"orphan\", root = path) ## ✔ 20231019-173958-d8042db4 (incoming_data) is valid ## ✔ 20231019-173959-9c2c2550 (analysis) is valid ## ✖ 20231019-174000-0c9fbed9 (incoming_data) is invalid due to its files ## ✔ 20231019-174000-688fe764 (random) is valid ## ✔ 20231019-174001-249b652f (use_shared) is valid orderly2::orderly_prune_orphans(root = path) ## ℹ Pruning 1 orphan packet"},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"debugging-and-coping-with-errors","dir":"Articles","previous_headings":"","what":"Debugging and coping with errors","title":"Introduction to orderly2","text":"(written)","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"interaction-with-version-control","dir":"Articles","previous_headings":"","what":"Interaction with version control","title":"Introduction to orderly2","text":"guidelines: Make sure exclude files git listing .gitignore: .outpack/ - nothing suitable version control archive/ - core.archive_path set non-null value, excluded. default archive draft/ - temporary draft directory orderly_envir.yml - used setting machine-specific configuration absolutely version control files: src/ main source analyses orderly_config.yml - high level configuration suitable sharing shared resource directory (configured orderly_config.yml) probably version controlled source repository end multiple people’s machines, configured differently. configuration option set via orderly2::orderly_config_set designed (potentially) different different users, configuration needs version controlled. also means reports/packets can’t directly refer values set . includes directory used save archive packets (enabled) names locations (equivalent git remotes). may find useful include scripts help users set common locations, like git, different users may use different names remote (e.g., one user may location called data another called data-incoming, depending perspective use location). orderly2 always try save information current state git source repository alongside packet metadata. includes current branch, commit (sha) remote url. try create links final version packet upstream source repository.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"interaction-with-the-outpack-store","dir":"Articles","previous_headings":"","what":"Interaction with the outpack store","title":"Introduction to orderly2","text":"alluded , .outpack directory contains lots information packets run, typically “bounds” normal use. effectively “database” information packets run. Understanding directory structured required using orderly, included avoidance mystery! See outpack documentation (vignette(\"outpack\")) details ideas . work , directory structure looks like: can perhaps inferred filenames, files .outpack/metadata/ metadata packet run. files .outpack/location// holds information packet first known location (location special “local” location). default orderly configuration store final files directory called archive/, alternatively (additionally) can use content- addressable file store. enabled, .outpack directory looks like: files .outpack/files/ never modified deleted. approach storage naturally deduplicates file archive, large file used many places ever stored .","code":"## .outpack ## ├── config.json ## ├── index ## │ └── outpack.rds ## ├── location ## │ ├── local ## │ │ ├── 20231019-173958-d8042db4 ## │ │ ├── 20231019-173959-9c2c2550 ## │ │ ├── 20231019-174000-688fe764 ## │ │ └── 20231019-174001-249b652f ## │ └── orphan ## └── metadata ## ├── 20231019-173958-d8042db4 ## ├── 20231019-173959-9c2c2550 ## ├── 20231019-174000-688fe764 ## └── 20231019-174001-249b652f ## .outpack ## ├── config.json ## ├── files ## │ └── sha256 ## │ ├── 0a ## │ │ └── a82571c21c4e5f1f435e8bef2328dda5ef47e177d78d63d1c4ec647a5a388a ## │ ├── 21 ## │ │ └── 1ab1ee3ca987d12d8074f59dfc4f79e67b6014a043a96c8b8ff24a2dcf084a ## │ ├── 23 ## │ │ └── 0cb6053c3bc82e67fc339c44b495852c77294bd3b0ccb5c4ba78b06b23e438 ## │ ├── 2b ## │ │ └── 1792109e549190c820c67d2daa5088bc8c0f5d9ef0a963ebb532812cfa3d53 ## │ ├── 5f ## │ │ └── 96f49230c2791c05706f24cb2335cd0fad5d3625dc6bca124c44a51857f3f8 ## │ ├── 64 ## │ │ └── 4f00712ea92675643262291eb73d56ca3de3d53108cdaea3cef8eff6b29523 ## │ ├── b9 ## │ │ └── de9ea05d849c5ca2a6e33389ddd47337c19095db47bddf34e7b6ea20052236 ## │ ├── c5 ## │ │ └── 2b620e18dee25dc15af7ee6c1f70f1722f6745705a220efe2e82a47bed3ead ## │ ├── d9 ## │ │ └── 1699ae410cbd811e1f028f8a732e5162b7df854eec08d921141f965851272d ## │ └── fe ## │ └── 98f159b23c072c3cb9ef5f3ed27db7c1f824849dcf5d78ad82c05d53884672 ## ├── index ## │ └── outpack.rds ## ├── location ## │ ├── local ## │ │ ├── 20231019-173958-d8042db4 ## │ │ ├── 20231019-173959-9c2c2550 ## │ │ ├── 20231019-174000-688fe764 ## │ │ └── 20231019-174001-249b652f ## │ └── orphan ## └── metadata ## ├── 20231019-173958-d8042db4 ## ├── 20231019-173959-9c2c2550 ## ├── 20231019-174000-688fe764 ## └── 20231019-174001-249b652f"},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"relationship-between-orderly-and-outpack","dir":"Articles","previous_headings":"","what":"Relationship between orderly and outpack","title":"Introduction to orderly2","text":"orderly2 package built metadata file storage system called outpack; implementing support working metadata archives languages (see outpack_server server implementation Rust outpack-py Python). metadata discussed detail vignette(\"metadata\") document general ideas fully mrc-ide/outpack","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"basic-overview","dir":"Articles","previous_headings":"","what":"Basic overview","title":"Outpack metadata","text":"“packet” conceptually directory, corresponding particular analysis data product, though necessarily stored. internal representation includes: metadata packet - files contains hashes along information done create environment created etc (see ) actual file contents every included file. might stored simple content-addressable file storage system (see ) actual copies directories originally created Every packet referenced uniquely primary key. use key format encodes current date time, well random data avoid collisions. exists dependency graph among packets, one packet depends another. edge graph hard link (one packet another id) also query (e.g., latest packet name) used find packet. means many ways looking thinking dependency graph. packets available locally, outpack repositories, typically (always) machines accessed HTTP API. conceptually similar git “remotes”. need distinguish packets “unpacked” (, packets every file available current archive) packets merely known (metadata files). sometimes refer unpacked packets “local” known “local” location special. use terms “archive” “repository” fairly interchangeably try nail .","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"what-goes-into-a-packet","dir":"Articles","previous_headings":"","what":"What goes into a packet","title":"Outpack metadata","text":"packet must things: name (example model_fits). changed (rather changes tracked) currently way namespacing different repositories id (see “outpack id” ) created outpack point packet started set parameters - mapping strings scalar type (boolean, number, string). Packets may zero many parameters. set files - local (relative) path within packet (e.g., output/data.csv) also hash (e.g., sha256:69f6cf230416cf40828da251a0dad17cbbf078587883e826f3345ff08d1aaa7d) Information packet run (start end time), represented seconds post epoch, UTC (see ). addition may contain information : dependencies used, tracking name included packet, query used find , resolved id, set files extracted packet (source name, hash destination name) names scripts run create packet (typically also included files within final packet) information state git point packet run (current branch, hash, etc) information system used run packet (format unspecified might include hostname, operating system version, package/module versions, etc) custom metadata added implementation","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"types-of-users-of-outpack","dir":"Articles","previous_headings":"","what":"Types of users of outpack","title":"Outpack metadata","text":"types “persona” outpack user imagine exist guide decisions abut layout . extremes : user desktop wants develop run analyses, using files present packets available server. want visually inspect results running packets, need see files disk way makes sense human, care complete copy dependencies graph. server instance responsible delivering packets users (e.g., persona ). expected (able fetch) part outpack graph, expect anyone want visually inspect packets directly machine (, storage need human-readable). impacts two configuration options associated parts directory structure : user use content-addressable “file store” human-readable “archive” (explained detail ) require archive contains complete tree dependencies? expect first persona wants human readable archive contain full tree, second wants opposite.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"directory-layout","dir":"Articles","previous_headings":"","what":"Directory layout","title":"Outpack metadata","text":"section discusses files directory make outpack work, much come ; see . typical .outpack directory layout looks like : (note archive/ .outpack level). directories necessarily present; indeed required file .outpack/config.json.","code":".outpack/ config.json files/ location/ metadata/ archive/"},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"configuration--outpackconfig-json","dir":"Articles","previous_headings":"Directory layout","what":"Configuration (.outpack/config.json)","title":"Outpack metadata","text":"outpack configuration schema defined config.json configuration format still subject change…","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"packet-metadata--outpackmetadata","dir":"Articles","previous_headings":"Directory layout","what":"Packet metadata (.outpack/metadata/)","title":"Outpack metadata","text":"file within directory filename outpack id (matching regular expression ^[0-9]{8}-[0-9]{6}-[0-9a-f]{8}$, see . file json file conforming schema metadata.json. present means outpack implementation can report information back packet (created, files contains, etc), packet metadata meaningful ; want know might come (location distributing packet) copy packet locally.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"location-information--outpacklocation","dir":"Articles","previous_headings":"Directory layout","what":"Location information (.outpack/location/)","title":"Outpack metadata","text":"directory matches regular expression ^[0-9]{8}$ (e.g., 457f4f2a) “location id” (see ) corresponding “location”. file within directory outpack id name, contains json location unpacked (installed) packet, hash metadata. file conforms schema location.json.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"a-file-store--outpackfiles","dir":"Articles","previous_headings":"Directory layout","what":"A file store (.outpack/files)","title":"Outpack metadata","text":"configuration option core.use_file_store true, outpack keeps content addressable file store files knows . much space efficient entire packet unpacked automatically deduplicates shared content among packets (e.g., large file present two packets stored ). file store layout described . storage format human-readable (indeed present within hidden directory .outpack). can enabled either server user","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"an-archive-archive-by-default","dir":"Articles","previous_headings":"Directory layout","what":"An archive (archive/ by default)","title":"Outpack metadata","text":"configuration option core.path_archive non-null directory path containing unpacked packets. packet available path “name” packet, outpack id. several files per packet, possibly directories. storage approach designed human readable, typically enabled outpack repository used laptop user wants interactively work files.","code":"archive///"},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"adding-a-packet","dir":"Articles","previous_headings":"","what":"Adding a packet","title":"Outpack metadata","text":"order make packet available locally, need import metadata files, mark packet available. roughly creating packet (.e., first place packet ever existed) importing packet elsewhere. Making packet available allows used dependency, allows serving packet acting location (http file protocols), guarantees files actually present locally.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"adding-metadata","dir":"Articles","previous_headings":"Adding a packet","what":"Adding metadata","title":"Outpack metadata","text":"can simply copy metadata file .outpack/metadata/ yet exist. make available anything yet known location. Dangling metadata (, metadata present directory known anywhere) currently mostly ignored.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"adding-files","dir":"Articles","previous_headings":"Adding a packet","what":"Adding files","title":"Outpack metadata","text":"repository uses file store, fill first, much easier think . can easily get difference files used packet (list files packet manifest) already file store looking hash turn. request missing files insert store. may leave “dangling” files (files referred packet) problem. repository human-readable archive uses file store, files present file store easy enough check file store requested path (local relative path packet manifest). update file store first, files guaranteed present. repository uses human readable archive, simplest thing request file remote. However, might efficient check locally previously fetched copies files content, verify modified, copy place rather re-downloading.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"marking-the-packet-as-unpacked-and-known-locally","dir":"Articles","previous_headings":"Adding a packet","what":"Marking the packet as unpacked and known locally","title":"Outpack metadata","text":"local location id, write file conforming location.json schema, containing packet id, time marked unpacked hash metadata.","code":".outpack//"},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"ordering-of-operations","dir":"Articles","previous_headings":"Adding a packet","what":"Ordering of operations","title":"Outpack metadata","text":"need files metadata packet marked unpacked; note configurations guarantee every packet unpacked complete tree. can import files first, metadata; lot disadvantage either. mark package unpacked known locally though components present.","code":""},{"path":[]},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"outpack-ids","dir":"Articles","previous_headings":"Details","what":"Outpack ids","title":"Outpack metadata","text":"Outpack ids match regular expression ^[0-9]{8}-[0-9]{6}-[0-9a-f]{8}$; encode UTC date-time prefix YYYYMMDD-HHMMSS- followed 8 hexadecimal digits. R implementation, encode current second first four digits (2 bytes) append 2 bytes cryptographically random data. id tries balance reasonable degree collision resistance (65536 combinations per millisecond), lexicographic sortability reasonable degree meaningfulness.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"location-ids","dir":"Articles","previous_headings":"Details","what":"Location ids","title":"Outpack metadata","text":"Location ids meaningless 4-byte (8 character) hex strings. immutable created different different machines even point location. location id mapped (via .outpack/config.json) location name human-readable name (e.g., production staging). requirement name different machines. One directories represents local location; can find mapping within configuration.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"representing-hashes","dir":"Articles","previous_headings":"Details","what":"Representing hashes","title":"Outpack metadata","text":"Outpack typically uses sha256 hashes, want able change future. wherever hash presented, algorithm included part string. example instead used md5 algorithm written schema currently assumes hash value represented hex string.","code":"sha256:69f6cf230416cf40828da251a0dad17cbbf078587883e826f3345ff08d1aaa7d md5:bd57f7123c6bfb95c3234ff56373b7f4"},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"times","dir":"Articles","previous_headings":"Details","what":"Times","title":"Outpack metadata","text":"store information times places (e.g., times packet run, imported, etc). Rather trying deal strings, always store time seconds since 1970-01-01 00:00.00 UTC (including fractional seconds, whatever accuracy system allows).","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"file-store","dir":"Articles","previous_headings":"Details","what":"File store","title":"Outpack metadata","text":"file store designed simple, sophisticated git, whose object store similar thing. general layout looks like: hopefully fairly obvious structure. Paths format: reason second level prevent performance degradation directories containing millions files, copying git. store designed cope different hashing algorithms, though R implementation outpack supports sha256 now. Multiple hashing algorithms supported hard linking content multiple places tree, might link ","code":".outpack/files sha256/ 5d/ dfaf1f4a2e15e8fe46dbed145bf2f84bba1b3367d0a56f73de08f8585dd153 ... 77/ ... // sha256/5d/dfaf1f4a2e15e8fe46dbed145bf2f84bba1b3367d0a56f73de08f8585dd153 md5/84/0bc6ad3ae479dccc1c49a1910b37bd"},{"path":[]},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"so-long-yaml-and-thanks-for-all-the-whitespace-errors","dir":"Articles","previous_headings":"Summary of changes","what":"So long YAML and thanks for all the whitespace errors","title":"Migrating from orderly (1.x)","text":"obvious user-facing change (almost) YAML, definition inputs outputs report now defined within R script (orderly.R). orderly report previously orderly.yml file looked like end within orderly.R script looks like: think much clearer, comes documentation autocomplete support IDEs. fact, simple reports, special functions required, though ’ll find useful (see vignette(\"orderly2\")) specific changes: longer need list packages packages:, instead just use library() ordinary script. record state session regardless get record used longer need use sources: list scripts want source, instead use source() normal global_resources become orderly2::orderly_shared_resource (aren’t really global much shared). Note directory now always shared/ orderly root, may configure .","code":"parameters: n_min: default: 10 script: script.R source: - functions.R resources: - metadata.csv depends: raw_data: id: latest use: raw_data.csv: data.csv artefacts: data: description: Processed data filenames: data.rds orderly2::orderly_parameters(n_min = 10) orderly2::orderly_dependency(\"raw_data\", \"latest\", files = c(\"raw_data.csv\" = \"data.csv\")) orderly2::orderly_resource(\"metadata.csv\") orderly2::orderly_artefact(\"Processed data\", \"data.rds\") source(\"functions.R\")"},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"implications","dir":"Articles","previous_headings":"Summary of changes > So long YAML and thanks for all the whitespace errors","what":"Implications","title":"Migrating from orderly (1.x)","text":"change widespread implications: can program things like dependencies, creating loop series parameter values, conditionally depending reports R script can basis orderly report, can add orderly functions annotating inputs outputs progressively","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"database-support-has-been-moved-into-a-plugin","dir":"Articles","previous_headings":"Summary of changes","what":"Database support has been moved into a plugin","title":"Migrating from orderly (1.x)","text":"version 1, built-support accessing data SQL databases; moved within orderly.db plugin. major features supported.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"no-more-commit","dir":"Articles","previous_headings":"Summary of changes","what":"No more commit","title":"Migrating from orderly (1.x)","text":"orderly2 longer requires separate orderly_commit() call orderly_run(); longer make distinction local draft archive packets. Instead, added finer-grained control dependencies resolved (locally, subset servers), generalises way draft/archive used practice. See ?orderly_run details dependencies resolved. implications deleting things; draft directory always easy target deletion, now deletion need tell orderly2 deleted things. See vignette(\"introduction\") details (section “Deleting things archive”).","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"no-more-testing-or-development-mode","dir":"Articles","previous_headings":"Summary of changes","what":"No more testing or development mode","title":"Migrating from orderly (1.x)","text":"two different, unsatisfactory, mechanisms developing orderly report: orderly_test_start (version 1.1.0) orderly_develop_start (1.1.0 onwards) worked initial setup, copying dependencies etc location work (new draft orderly_test_start source directory orderly_develop_start). orderly2 can just work directly within source directory, long working directory set src/, orderly2 commands work expected. orderly1, need careful commit (git) results running analysis, encourage per-report .gitignore files help .","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"new-language-agnostic-backend","dir":"Articles","previous_headings":"Summary of changes","what":"New, language-agnostic, backend","title":"Migrating from orderly (1.x)","text":"biggest change, perhaps least visible, orderly now built open spec outpack can implemented language. develop Python implementation , possibly languages. takes control metadata. split “orderly_” “outpack_” functions package, information see last section vignette(\"introduction\") also vignette(\"outpack\").","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"other-smaller-changes","dir":"Articles","previous_headings":"Summary of changes","what":"Other, smaller changes","title":"Migrating from orderly (1.x)","text":"“Global” resources become “shared” resources, always live shared/ orderly root (.e., longer configurable). reason want reports able run fairly independently orderly2 configuration (exception plugins). practice people really vary .","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"what-is-missing-compared-with-orderly1","dir":"Articles","previous_headings":"","what":"What is missing compared with orderly1","title":"Migrating from orderly (1.x)","text":"changelog feature (implement something support ) extraction secrets vault (support ) automatic handling README files (may implement support )","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"how-to-migrate","dir":"Articles","previous_headings":"","what":"How to migrate","title":"Migrating from orderly (1.x)","text":"two parts migration: updating canonical copy orderly archive (ideally one ) updating source tree. steps done via outpack.orderly package. migrate archive first. every archive want retain (might archives stored locally, production servers staging servers). Archive migration happens place; , modify anything original location. archive old used old versions orderly1 possible process hiccups. Please let us know case. result process end new directory contains new archive conforming outpack spec containing orderly2 metadata. Next, migrate source tree. done place done fresh clone source git repository. report, examine orderly.yml files script files (often script.R), delete , write new orderly.R file adapt report work orderly2. possible perfect might need minor tweaking hopefully reasonable. One thing preserved (probably ) comments yaml often refer yaml formatting orderly1 features hopefully much problem. probably want manually tweak generated code anyway, take advantage new orderly2 features able compute dependencies. using OrderlyWeb, probably need pause migrating, replacement yet ready.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"what-about-the-packages","dir":"Articles","previous_headings":"","what":"What about the packages?","title":"Migrating from orderly (1.x)","text":"merge orderly2 orderly package, ready release can use . However, anticipate period coexistence legacy orderly1 systems develop orderly2. help small helper package orderly.helper can smooth namespace differences; may useful interact versions.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"what-were-the-problems-in-version-1","dir":"Articles","previous_headings":"","what":"What were the problems in version 1","title":"Migrating from orderly (1.x)","text":"YAML format inflexible, error prone users, leads duplication focussed around initial needs Vaccine Impact Modelling Consortium fairly easy get archive SQLite database inconsistent state (e.g., deleting moving files archive) SQLite database behaved poorly shared file systems","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/orderly2.html","id":"collaborative-analysis","dir":"Articles","previous_headings":"","what":"Collaborative analysis","title":"orderly2","text":"Many analyses involve single person single machine; case number workflow tools make orchestrating analysis easy. workflow model graph dependencies analysis, data flows. example might update data, whole pipeline rerun. update code forecast, forecasts report rerun. experience, model works well single-user setting falls collaborative setting, especially analysis partitioned person; Alice handling data pipeline, Bob running fits, Carol organising forecasts final report. context, changes upstream affect downstream analysis, require set care around integration might used version controlling source code. example, Alice dealing change incoming data format going break analysis time Bob trying get model fits working, Bob trying integrate code changes Alice’s new data. typically deal source code using branches within git; code Bob work branch isolated Alice’s changes. contexts like () data analysis products git. needed way versioning outputs step analysis controlling integrated subsequent analyses. Another way looking problem seek way making analysis composable way functions OOP achieve programs, way docker containerisation achieved deploying software. need way putting interfaces around pieces analysis allow people refer fetch somewhere run. conceptual pieces needed : way referring unambiguously (globally) piece analysis can depended upon, everyone can agree ’re talking piece analysis system storage results running analysis can shared among group system control integration pieces analysis takes place refer transportable unit analysis “packet”. conceptually directory files created running code, atomic unit work point view orderly. packet underlying source form, anyone can run. However, time people use pre-run packets collaborators run inputs onward analyses (see vignette(\"dependencies\") vignette(\"collaboration\") details).","code":"[raw data] -> [processed data] -> [model fits] -> [forecasts] -> [report]"},{"path":"https://mrc-ide.github.io/orderly2/articles/orderly2.html","id":"reproducible-analyses","dir":"Articles","previous_headings":"","what":"Reproducible analyses","title":"orderly2","text":"degree collaboration style requires reproducibility, several aspects . system describe , even though everyone can typically run step analysis, typically don’t. differs workflow tools, users may familiar .","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/orderly2.html","id":"difference-from-a-workflow-system","dir":"Articles","previous_headings":"Reproducible analyses","what":"Difference from a workflow system","title":"orderly2","text":"Workflow systems hugely influential scientific computing, people co-opting build systems like make sophisticated systems designed parallel running large complex workflows nextflow. general approach define interdependencies among parts analysis, forming graph parts analysis track inputs outputs workflow. model computation lots good points: defines interface analysis allows (encourages) breaking monolithic analysis component pieces can reasoned allows high-level parallelism making obvious parts workflow can run concurrently tracking way data flows analysis, allows minimum amount recalculation done change, downstream parts triggered shared workspace online runner, allows degree collaboration long everyone happy working constantly changing set code analysis artefacts designed orderly2 working patterns suit . motivating reasons include: nodes computational graph expensive compute require exotic hardware. Workflows upstream data never settle, need know version data ends used particular analysis Workflows upstream analyses used many downstream analyses, upstream developer may know much downstream use Nondeterministic analyses, e.g., involving stochastic simulations, rerunning node expected return exact numerical results, can’t rely different users recovering results different occasions[*] cases missing piece need way versioning nodes within computational graph, shifting emphasis automatically rerunning portions graph tracking data flowed graph. turn shifts reproducibility emphasis “everyone run code get results” “everyone run code, instead work results”. familiar docker, approach similar working pre-built docker images, whereas workflow approach similar working directly Dockerfiles; many situations end result , approaches differ guarantees, computation happens, users refer versions. [*] discourage trying force determinism manually setting seeds, potential violate statistical properties random number streams, fragile best.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/orderly2.html","id":"what-is-reproducibility-anyway","dir":"Articles","previous_headings":"Reproducible analyses","what":"What is reproducibility anyway?","title":"orderly2","text":"Reproducibility means different things different people, even within narrow sense “rerun analysis retrieve results”. last decade, idea one able rerun piece analysis retrieve results slightly morphed one must rerun piece analysis. Similarly, emphasis utility reproducibility shifted authors able rerun work (confidence rerun ) hypothetical third party wanting rerun analysis. approach flips perspective around bit, based experiences collaborative research projects, draws (overly) ambitious aim : Can prove given set inputs produced given set outputs? quickly found impossible, provided systems place one satisfied statement given level trust system. piece analysis comes server primary way people run analyses web front-end (currently OrderlyWeb, soon Packit) know analysis run end--end modification orderly2 preserves inputs alongside outputs files present final packet files went analysis, recorded R package versions full set used. system naturally involves running multiple machines (typically analysts’ laptops, server perhaps HPC environment), way orderly2 treats paths, practically little problem getting analyses working multiple places, trivially satisfying typical reproducibility aim, even though people typically focussed . shift focus proved valuable. analysis run one occasion (e.g., regular reporting, simply updating figure final submission manuscript revision), outputs may change. Understanding changes happened important. orderly2 automatically saves lot metadata run easy find things might changed. , can start interrogating graph among packets find effect change ; find previously run packets pulled old version data set, used previous release package.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/plugins.html","id":"the-basic-idea","dir":"Articles","previous_headings":"","what":"The basic idea","title":"Creating plugins","text":"plugin provided package, possibly thing package provides. plugin name must (currently) package name. functions package needs call orderly2::orderly_plugin orderly2::orderly_plugin_register create register plugin, respectively. make plugin available orderly project, two new bits configuration may present orderly_config.yml - one declares plugin used, configures plugin. use plugin individual report, functions plugin used, configure use plugin. Finally, can save information back final orderly2 metadata plugin . yaml-less design orderly2 (see vignette(\"migrating\") familiar orderly1), line plugin just package code fairly blurred, reasons writing plugin typically want make something easier reports, want action reflected orderly metadata.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/plugins.html","id":"an-example","dir":"Articles","previous_headings":"","what":"An example","title":"Creating plugins","text":"example, ’ll implement stripped version database plugin inspired work (see `orderly.db fuller implementation). make work need functions: …process additional fields orderly_config.yml describe find database …can called orderly.R access database …can add metadata final orderly metadata done ’ll start report side things, describing want happen, work implementation. directory structure minimal project orderly_config.yml file contains information shared possible uses plugin - case connection information database: plugin called example.db listed within plugins section, along configuration; case indicating path SQLite file can loaded . orderly.R file contains information use database specific report; case, making results query SELECT * mtcars cyl == 4 database available R object dat Normally, imagine calculation kept minimal purpose demonstration. implement need : create package write function handle configuration orderly_config.yml write function query() used orderly.R query ","code":"## . ## ├── orderly_config.yml ## └── src ## └── example ## └── orderly.R minimum_orderly_version: 1.99.0 plugins: example.db: path: /tmp/RtmpemCqxC/file1d4123c077dc example.db::query(sql = \"SELECT * FROM mtcars WHERE cyl == 4\", as = \"dat\") orderly2::orderly_artefact(\"Summary of data\", \"data.rds\") saveRDS(summary(dat), \"data.rds\")"},{"path":"https://mrc-ide.github.io/orderly2/articles/plugins.html","id":"create-a-tiny-package","dir":"Articles","previous_headings":"An example","what":"Create a tiny package","title":"Creating plugins","text":"lots package skeleton tools , favourite, usethis::create_package() probably reasonable job. thing package needs contain Imports: orderly2 DESCRIPTION field. simple package may structure like , DESCRIPTION file contains: NAMESPACE R/plugin.R files shown .","code":"## . ## ├── DESCRIPTION ## ├── NAMESPACE ## └── R ## └── plugin.R Package: example.db Version: 0.0.1 License: CC0 Title: Orderly Database Example Plugin Description: Simple example of an orderly plugin. Authors@R: person('Orderly Authors', role = c('aut', 'cre'), email = 'email@example.com') Imports: orderly2"},{"path":"https://mrc-ide.github.io/orderly2/articles/plugins.html","id":"handle-the-configuration","dir":"Articles","previous_headings":"An example","what":"Handle the configuration","title":"Creating plugins","text":"required function plugin needs provide one process data orderly_config.yml. probably primarily concerned validation can fairly simple first, later ’ll expand report errors nicely: arguments data: deserialised section orderly_config.yml specific plugin filename: full path orderly_config.yml return value data argument auxiliary data added validation.","code":"db_config <- function(data, filename) { data }"},{"path":"https://mrc-ide.github.io/orderly2/articles/plugins.html","id":"evaluate-the-query","dir":"Articles","previous_headings":"An example","what":"Evaluate the query","title":"Creating plugins","text":"Finally, minimal example, need function actually query; example example.db::query: arguments whatever want user provide – nothing special orderly2. important function call orderly2::orderly_plugin_context returns information can use make plugin work. explained ?orderly2::orderly_plugin_context, example use two elements: config: configuration plugin (.e., return value function db_config) envir: (R) environment current packet using modify packet environment writing ctx$envir. Finally, return metadata save final packet metadata, return NULL, always empty. Later, ’ll show change . last bit package code register plugin, calling orderly2::orderly_plugin_register within .onLoad() special R function called package loaded. means whenever packages loaded (regardless whether attached) register plugin. (important name argument matches package name, orderly2 trigger loading package based name configuration; may support multiple plugins within one page later.) Note query function appear within registration, just function read process configuration. final (minimal) package code : NAMESPACE file contains","code":"query <- function(sql, as) { ctx <- orderly2::orderly_plugin_context(\"example.db\") dbname <- ctx$config$path con <- DBI::dbConnect(RSQLite::SQLite(), dbname) on.exit(DBI::dbDisconnect(con)) d <- DBI::dbGetQuery(con, sql) ctx$envir[[as]] <- d invisible() } .onLoad <- function(...) { orderly2::orderly_plugin_register( name = \"example.db\", config = db_config) } db_config <- function(data, filename) { data } query <- function(sql, as) { ctx <- orderly2::orderly_plugin_context(\"example.db\") dbname <- ctx$config$path con <- DBI::dbConnect(RSQLite::SQLite(), dbname) on.exit(DBI::dbDisconnect(con)) d <- DBI::dbGetQuery(con, sql) ctx$envir[[as]] <- d invisible() } .onLoad <- function(...) { orderly2::orderly_plugin_register( name = \"example.db\", config = db_config) } db_config <- function(data, filename) { data } query <- function(sql, as) { ctx <- orderly2::orderly_plugin_context(\"example.db\") dbname <- ctx$config$path con <- DBI::dbConnect(RSQLite::SQLite(), dbname) on.exit(DBI::dbDisconnect(con)) d <- DBI::dbGetQuery(con, sql) ctx$envir[[as]] <- d invisible() } .onLoad <- function(...) { orderly2::orderly_plugin_register( name = \"example.db\", config = db_config) }"},{"path":"https://mrc-ide.github.io/orderly2/articles/plugins.html","id":"trying-it-out","dir":"Articles","previous_headings":"An example","what":"Trying it out","title":"Creating plugins","text":"order test package, needs loaded. can either installing package using pkgload::load_all() (may find pkgload::load_all(export_all = FALSE) gives reliably experience. Now, can run report:","code":"pkgload::load_all() ## ℹ Loading example.db orderly2::orderly_run(\"example\", root = path_root) ## ℹ Starting packet 'example' `20231019-174014-d69e076b` at 2023-10-19 17:40:14.845538 ## > example.db::query(sql = \"SELECT * FROM mtcars WHERE cyl == 4\", as = \"dat\") ## > orderly2::orderly_artefact(\"Summary of data\", \"data.rds\") ## > saveRDS(summary(dat), \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231019-174014-d69e076b at 2023-10-19 17:40:15.00709 (0.1615522 secs) ## [1] \"20231019-174014-d69e076b\""},{"path":"https://mrc-ide.github.io/orderly2/articles/plugins.html","id":"making-the-plugin-more-robust","dir":"Articles","previous_headings":"","what":"Making the plugin more robust","title":"Creating plugins","text":"plugin fairly fragile validation input data orderly_config.yml orderly.yml. fairly annoying yaml incredibly flexible reporting back information user might gone wrong hard. case, expect single key-value pair orderly_config.yml key path value path SQLite database. can easily expand configuration function report better back user misconfigure plugin: acceptable job preventing poor input suggesting user might look within configuration fix . Note return configuration data , can augment (otherwise change) data need.","code":"db_config <- function(data, filename) { if (!is.list(data) || !is.null(names(data)) || length(data) == 0) { stop(\"Expected a named list for orderly_config.yml:example.db\") } if (length(data$path) != 1 || !is.character(data$path)) { stop(\"Expected a string for orderly_config.yml:example.db:path\") } if (!file.exists(data$path)) { stop(sprintf( \"The database '%s' does not exist (orderly_config:example.db:path)\", data$path)) } data }"},{"path":"https://mrc-ide.github.io/orderly2/articles/plugins.html","id":"saving-metadata-about-what-the-plugin-did","dir":"Articles","previous_headings":"","what":"Saving metadata about what the plugin did","title":"Creating plugins","text":"Nothing plugin saved report metadata unless save . Partly orderly.yml, saved final directory, serves sort record. However, probably want know something data returned . example might want save query string later can query without read process orderly.yml file statistics size data (e.g., number rows returned, columns) perhaps summary content hash can see content changed different versions report save metadata, use function orderly2::orderly_plugin_add_metadata; takes arguments plugin name, string like structure saved metadata (’ll use query) whatever data want save: function otherwise minimal version . also need provide serialisation function ensure metadata saved expected. saved metadata key query, get list back element query unnamed list many elements query calls given report. , ensure everything except cols length 1 (everything) gets turned scalar (1 [1]) serialise jsonlite::toJSON auto_unbox TRUE. Taking step , can also specify schema metadata conform save file inst/schema.json within package (path within inst fine). Now, register plugin, provide path schema, along serialisation function: Now, orderly metadata saved (just running script part report) validate output passed orderly2::orderly_plugin_add_metadata schema, jsonvalidate installed (currently requires development version) R option outpack.schema_validate set TRUE (e.g., running options(outpack.schema_validate = TRUE)). final package structure: DESCRIPTION file NAMESPACE unchanged , schema shown just . plugin.R file contains code collected : (code .R file package, across several).","code":"query <- function(sql, as) { ctx <- orderly2::orderly_plugin_context(\"example.db\") dbname <- ctx$config$path con <- DBI::dbConnect(RSQLite::SQLite(), dbname) on.exit(DBI::dbDisconnect(con)) d <- DBI::dbGetQuery(con, sql) ctx$envir[[as]] <- d info <- list(sql = sql, as = as, rows = nrow(d), cols = names(d)) orderly2::orderly_plugin_add_metadata(\"example.db\", \"query\", info) invisible() } orderly_db_serialise <- function(data) { for (i in seq_along(data$query)) { # Always save cols as a vector, even if length 1: data$query[[i]]$cols <- I(data$query[[i]]$cols) } jsonlite::toJSON(data, auto_unbox = TRUE) } { \"$schema\": \"http://json-schema.org/draft-07/schema#\", \"type\": \"object\", \"additionalProperties\": { \"type\": \"object\", \"properties\": { \"query\": { \"type\": \"string\" }, \"rows\": { \"type\": \"number\" }, \"cols\": { \"type\": \"array\", \"items\": { \"type\": \"character\" } } }, \"required\": [\"query\", \"rows\", \"cols\"], \"additionalProperties\": false } } .onLoad <- function(...) { orderly2::orderly_plugin_register( name = \"example.db\", config = db_config, serialise = db_serialise, schema = \"schema.json\") } ## . ## ├── archive ## │ └── example ## │ └── 20231019-174014-d69e076b ## │ ├── data.rds ## │ └── orderly.R ## ├── draft ## │ └── example ## ├── orderly_config.yml ## └── src ## └── example ## └── orderly.R db_config <- function(data, filename) { if (!is.list(data) || !is.null(names(data)) || length(data) == 0) { stop(\"Expected a named list for orderly_config.yml:example.db\") } if (length(data$path) != 1 || !is.character(data$path)) { stop(\"Expected a string for orderly_config.yml:example.db:path\") } if (!file.exists(data$path)) { stop(sprintf( \"The database '%s' does not exist (orderly_config:example.db:path)\", data$path)) } data } query <- function(sql, as) { ctx <- orderly2::orderly_plugin_context(\"example.db\") dbname <- ctx$config$path con <- DBI::dbConnect(RSQLite::SQLite(), dbname) on.exit(DBI::dbDisconnect(con)) d <- DBI::dbGetQuery(con, sql) ctx$envir[[as]] <- d info <- list(sql = sql, as = as, rows = nrow(d), cols = names(d)) orderly2::orderly_plugin_add_metadata(\"example.db\", \"query\", info) invisible() } .onLoad <- function(...) { orderly2::orderly_plugin_register( name = \"example.db\", config = db_config, serialise = db_serialise, schema = \"schema.json\") }"},{"path":"https://mrc-ide.github.io/orderly2/articles/plugins.html","id":"potential-uses","dir":"Articles","previous_headings":"","what":"Potential uses","title":"Creating plugins","text":"need functionality similar example - pulling database functionality original version orderly something independent, turns useful fraction orderly use-cases. can imagine potential uses though, : Non-DBI-based database data extraction, customised routines pulling data database Download files shared location just use (e.g., SharePoint, OneDrive, AWS). orderly_config.yml contain account connection details orderly.yml contain mapping remote data/files local files. Rather writing environment , use path argument copy files correct place. Pull data web API just running follow basic pattern requiring configuration order able connect resource service, specification resources fetched, action actually fetch resource put place.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/query.html","id":"structure-of-queries","dir":"Articles","previous_headings":"","what":"Structure of queries","title":"Orderly query DSL","text":"simple query finds recent packet; unlikely useful without scoping - see . complex queries expressed syntax valid R (also valid Julia close valid Python). complex query composed “tests” Every “test” uses boolean operator (<, >, <=, >=, ==, !=) left right hand side can one : lookup outpack metadata (parameter:x value parameter called x, name name packet, id id packet) lookup provided data pars (:x value pars$x) literal value (e.g., \"some_name\", 1, TRUE) Tests can grouped together (, !, &&, || might expect: parameter:x == 1 || parameter:x == 2 finds packets parameter x 1 2 name == \"data\" && parameter:x > 3 finds packets called “data” parameter x greater 3 (parameter:y == 2) && !(parameter:x == 1 || parameter:x == 2) finds parameter y 2 parameter x anything 1 2 (also written (parameter:y == 2) && (parameter:x != 1 && parameter:x != 2)) four functions latest(expr) finds latest packet satisfying expr - always returns length 1 character, NA_character_ suitable packet found. expr given latest packets returned. single(expr) like latest(expr) except error expr evaluate exactly one packet id usedby(expr, FALSE) expr either literal id expression returns 1 id. finds packets used generation packet id returned expr (see dependencies section details).","code":"latest() name == \"some_name\" parameter:x > 1"},{"path":"https://mrc-ide.github.io/orderly2/articles/query.html","id":"special-simple-queries","dir":"Articles","previous_headings":"","what":"Special simple queries","title":"Orderly query DSL","text":"two shorthand queries: latest equivalent latest() (useful applied scope) string matching regular expression id (^([0-9]{8}-[0-9]{6}-[[:xdigit:]]{8})$) equivalent single(id == \"\") \"\" string provided)","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/query.html","id":"scoping-queries","dir":"Articles","previous_headings":"","what":"Scoping queries","title":"Orderly query DSL","text":"WARNING: may remove Scoping queries can used shorthand filtering returned packets. future used reduce set packets searched speed query evaluation. join together main query (scope) && (expr), except expr call latest single. case combine latest((scope) && (expr)) single((scope) && (expr)). useful want limit search particular name location perform detailed search. example, query equivalent orderly2 uses functionality resolving dependencies orderly2::orderly_dependency.","code":"orderly_query(quote(parameter:x == 1), scope = quote(name == \"data\")) orderly_query(quote(parameter:x == 1 && name == \"data\"))"},{"path":"https://mrc-ide.github.io/orderly2/articles/query.html","id":"scoping-on-name","dir":"Articles","previous_headings":"Scoping queries","what":"Scoping on name","title":"Orderly query DSL","text":"often users want scope name instead passing scope argument shorthand name argument usability. equivalent ","code":"orderly_query(quote(parameter:x == 1), name = \"data\") orderly_query(quote(parameter:x == 1), scope = quote(name == \"data\"))"},{"path":"https://mrc-ide.github.io/orderly2/articles/query.html","id":"dependencies","dir":"Articles","previous_headings":"","what":"Dependencies","title":"Orderly query DSL","text":"2 packets, B depends output (.e. call (id_a, ...) running packet B) can draw . equivalently say dependency B, B depends used B , B uses parent B, B child tree dependencies among packets might want search packets used another packet. can use query function usedby(id) list packets used id. search recursively packets used id parents parents’ parents . optional second arg immediate FALSE default, set TRUE search immediate (e.g. level 1) dependencies. able search dependencies like means packet structure like want know id used C can find using orderly_search usedby can combined groupings scope: depth usedby recurse can controlled setting depth e.g. search just immediate parents C. depth can positive integer, default depth recurse finds parents. usedby can simplified using subqueries. Subqueries denoted curly braces {} can either named passed subquery arg can anonymous. query equivalent uses subquery C. two important things note usedby: query inside usedby search entire index, ignoring scope name parameters. want find packets used latest C. subquery C scoped return results. query inside usedby must return single result. ensure must either literal id, call latest call single well searching dependency tree using usedby can search uses function. setup reports , B C want know id C uses can find using uses usedby can combined search complex arrangements dependencies. something like want search version E depends version used latest C can via searches tree C tree find version E. Note important added name == \"\" condition , missing usedby(latest(name == \"C\")) also return B single throw error multiple packets. can also search tree find D e.g. note E packet uses D need add name == \"E\" clause. can combine usedby uses complex searches, find D C run","code":"orderly_search(quote(usedby(latest(name == \"C\"))), name = \"A\") orderly_search(quote(usedby(latest(name == \"C\")) && parameter:year == 2022), name = \"A\") orderly_search(quote(usedby(latest(name == \"C\"), depth = 1)), name = \"A\") orderly_search(quote(usedby({C}) && parameter:year == 2022), name = \"A\", subquery = list(C = quote(latest(name == \"C\")))) orderly_search(quote(uses(latest(name == \"A\"))), name = \"C\") orderly_search( quote(latest(uses(single(usedby(latest(name == \"C\")) && name == \"A\")))), name = \"E\") orderly_query( quote(usedby(single(uses(name == \"D\")))), name = \"A\", root = root) orderly_query( quote(usedby(single(uses(single(usedby(latest(name == \"C\")) && name == \"A\"))) && name == \"E\"))), name = \"D\", root = root)"},{"path":[]},{"path":"https://mrc-ide.github.io/orderly2/articles/query.html","id":"simple-things","dir":"Articles","previous_headings":"Possible future queries and interface improvements","what":"Simple things","title":"Orderly query DSL","text":"orderly1 supports .null(parameter:x) might generalise support However, Python None Julia nothing, complicates things. Alternatively use missing(parameter:x)?","code":"parameter:x == NULL"},{"path":"https://mrc-ide.github.io/orderly2/articles/query.html","id":"explain-the-query","dir":"Articles","previous_headings":"Possible future queries and interface improvements","what":"Explain the query","title":"Orderly query DSL","text":"Often, people want know “packet match”? good show query set packets fail query excluded. definitely bit work.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/troubleshooting.html","id":"outpack-files-accidentally-committed-to-git","dir":"Articles","previous_headings":"","what":"Outpack files accidentally committed to git","title":"Troubleshooting","text":"discussed orderly introduction, want commit files .outpack/, drafts/ archive/ (used) git create sorts problems line. directed , probably ended files git want undo situation. least painful way depends situation. now put guard rails try prevent happening, still happen modify .gitignore file force-add files example. situation, orderly2 shout : may directed page. just want continue working anyway, run suggested command: things work warning first time session: subsequent calls display warning: rest section discusses might permanently fix issue.","code":"orderly2::orderly_run(\"data\", root = path) ## Error in `orderly2::orderly_run()`: ## ! Detected 6 outpack files committed to git ## ✖ Detected files were found in '.outpack/' and 'archive/' ## ℹ For tips on resolving this, please see ## ## ℹ To turn this into a warning and continue anyway set the option ## 'orderly_git_error_is_warning' to TRUE by running ## options(orderly_git_error_is_warning = TRUE) options(orderly_git_error_is_warning = TRUE) orderly2::orderly_run(\"data\", root = path) ## Warning in orderly2::orderly_run(\"data\", root = path): Detected 6 outpack files committed to git ## ✖ Detected files were found in '.outpack/' and 'archive/' ## ℹ For tips on resolving this, please see ## ## This warning is displayed once per session. ## ✔ Wrote '.gitignore' ## ℹ Starting packet 'data' `20231019-174025-d105fee6` at 2023-10-19 17:40:25.821887 ## > orderly2::orderly_artefact(\"Final data\", \"data.rds\") ## > saveRDS(mtcars, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231019-174025-d105fee6 at 2023-10-19 17:40:25.88127 (0.05938292 secs) ## [1] \"20231019-174025-d105fee6\" orderly2::orderly_run(\"data\", root = path) ## ℹ Starting packet 'data' `20231019-174026-0244e518` at 2023-10-19 17:40:26.014571 ## > orderly2::orderly_artefact(\"Final data\", \"data.rds\") ## > saveRDS(mtcars, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231019-174026-0244e518 at 2023-10-19 17:40:26.052328 (0.03775716 secs) ## [1] \"20231019-174026-0244e518\""},{"path":"https://mrc-ide.github.io/orderly2/articles/troubleshooting.html","id":"i-dont-care-about-my-history-at-all","dir":"Articles","previous_headings":"Outpack files accidentally committed to git","what":"I don’t care about my history at all","title":"Troubleshooting","text":"case just started project, yet collaborating anyone else (person willing re-clone sources). simplest thing : Delete .git directory entirely Run orderly2::orderly_gitignore_update(\"(root)\") set reasonable .gitignore prevent situation happening Run git add . add everything back (review git status make sure ’re happy) Run git commit -m \"Initial commit\" create single commit contains files currently repo history, also .outpack files previously pushed repo GitHub similar need set git remote add origin https://github.com/user/repo (replacing user/repo path, using git@github.com:user/repo use ssh talk GitHub) git branch -M main assuming using main default branch, now common git push --force -u origin main Note destructive require coordination collaborators changed history.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/troubleshooting.html","id":"i-just-want-this-to-go-away-and-nothing-i-have-committed-is-very-large","dir":"Articles","previous_headings":"Outpack files accidentally committed to git","what":"I just want this to go away and nothing I have committed is very large","title":"Troubleshooting","text":"care history, also committed files (e.g., committed files .outpack/ small large 100MB file archive/ preventing pushing GitHub) just delete offending files git without updating history, affecting local copies. Run git rm --cached .outpack (repeating draft archive needed) Run orderly2::orderly_gitignore_update(\"(root)\") set reasonable .gitignore prevent situation happening Run git add .gitignore also stage Run git commit -m \"Delete unwanted outpack files\" can push without issues.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/troubleshooting.html","id":"i-care-about-my-history-but-want-this-stuff-gone","dir":"Articles","previous_headings":"Outpack files accidentally committed to git","what":"I care about my history but want this stuff gone","title":"Troubleshooting","text":"working branch, unwanted files committed branch, simplest thing copy changes made somewhere safe, create new branch current main copy changes . somewhat automatically generating applying patch: unwanted files committed onto default branch, potentially gory history rewriting. See StackOverflow question, git docs currently recommended tool . Good luck!","code":"git diff -- src > changes.patch git checkout main git checkout -b changes-attempt2 git apply changes.patch git push -u origin changes-attempt2"},{"path":"https://mrc-ide.github.io/orderly2/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Rich FitzJohn. Author, maintainer. Robert Ashton. Author. Alex Hill. Author. Imperial College Science, Technology Medicine. Copyright holder.","code":""},{"path":"https://mrc-ide.github.io/orderly2/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"FitzJohn R, Ashton R, Hill (2023). orderly2: Orderly Next Generation. R package version 1.99.9, https://github.com/mrc-ide/orderly2.","code":"@Manual{, title = {orderly2: Orderly Next Generation}, author = {Rich FitzJohn and Robert Ashton and Alex Hill}, year = {2023}, note = {R package version 1.99.9}, url = {https://github.com/mrc-ide/orderly2}, }"},{"path":"https://mrc-ide.github.io/orderly2/index.html","id":"orderly2","dir":"","previous_headings":"","what":"Orderly Next Generation","title":"Orderly Next Generation","text":"attendant hospital responsible non-medical care patients maintenance order cleanliness. soldier carries orders performs minor tasks officer. orderly2 package designed help make analysis reproducible. principal aim automate series basic steps process writing analyses, making easy : track inputs analysis (packages, code, data resources) store multiple versions analysis repeated track outputs analysis create analyses depend outputs previous analyses","code":""},{"path":"https://mrc-ide.github.io/orderly2/index.html","id":"get-started","dir":"","previous_headings":"","what":"Get started","title":"Orderly Next Generation","text":"Two vignettes provide overview package, depending tastes: vignette(\"orderly2\") describes problem orderly2 tries solve (read package website) vignette(\"introduction\") describes orderly2 example, walking basic features (read package website)","code":""},{"path":"https://mrc-ide.github.io/orderly2/index.html","id":"roadmap","dir":"","previous_headings":"","what":"Roadmap","title":"Orderly Next Generation","text":"package ground-rewrite orderly package, now ready use new projects adventurous users original package. next months orderly renamed orderly1, finalise API package. stable, rename back orderly2 orderly release CRAN replace existing package. migration path existing users described vignette(\"migrating\") updated based experience migrating people. web framework OrderlyWeb rewritten parallel (packit) provide migration path .","code":""},{"path":"https://mrc-ide.github.io/orderly2/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Orderly Next Generation","text":"Please install r-universe: prefer, can install GitHub remotes:","code":"install.packages( \"orderly2\", repos = c(\"https://mrc-ide.r-universe.dev\", \"https://cloud.r-project.org\")) remotes::install_github(\"mrc-ide/orderly2\")"},{"path":"https://mrc-ide.github.io/orderly2/index.html","id":"testing","dir":"","previous_headings":"","what":"Testing","title":"Orderly Next Generation","text":"run tests, need outpack_server available system path. One way achieve run tests also require development versions gert jsonvalidate. can installed rOpenSci r-universe, : Without , tests skipped, suite still run.","code":"cargo install --git https://github.com/mrc-ide/outpack_server install.packages( c(\"gert\", \"jsonvalidate\"), repos = c(\"https://ropensci.r-universe.dev\", \"https://cloud.r-project.org\"))"},{"path":"https://mrc-ide.github.io/orderly2/index.html","id":"licence","dir":"","previous_headings":"","what":"Licence","title":"Orderly Next Generation","text":"MIT © Imperial College Science, Technology Medicine","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_artefact.html","id":null,"dir":"Reference","previous_headings":"","what":"Declare orderly artefacts — orderly_artefact","title":"Declare orderly artefacts — orderly_artefact","text":"Declare artefact. turn number orderly features; see Details . can multiple calls function within orderly script.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_artefact.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Declare orderly artefacts — orderly_artefact","text":"","code":"orderly_artefact(description, files)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_artefact.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Declare orderly artefacts — orderly_artefact","text":"description name artefact files files within artefact","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_artefact.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Declare orderly artefacts — orderly_artefact","text":"Undefined","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_artefact.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Declare orderly artefacts — orderly_artefact","text":"(1) files matching copied src directory draft directory unless also listed resource orderly_resource(). feature enabled call function top level orderly script contains string literals (variables). (2) script fails produce files, orderly_run() fail, guaranteeing task really produce things need . (3) within final metadata, artefacts additional metadata; description provide grouping","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_cleanup.html","id":null,"dir":"Reference","previous_headings":"","what":"Clean up source directory — orderly_cleanup","title":"Clean up source directory — orderly_cleanup","text":"Find, delete, file generated running report. comfortable , strongly recommended run orderly_cleanup_status first see deleted.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_cleanup.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clean up source directory — orderly_cleanup","text":"","code":"orderly_cleanup(name = NULL, dry_run = FALSE, root = NULL, locate = TRUE) orderly_cleanup_status(name = NULL, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_cleanup.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clean up source directory — orderly_cleanup","text":"name Name report directory clean (.e., look src/ relative orderly root dry_run Logical, indicating delete anything, instead just print information root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, just outpack (see orderly_init details). locate Logical, indicating configuration searched . TRUE config given, orderly looks working directory parents finds .outpack directory","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_cleanup.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Clean up source directory — orderly_cleanup","text":"(currently unstable) object class orderly_cleanup_status within element delete indicates files deleted (orderly_cleanup_status) deleted (orderly_cleanup)","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_cleanup.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Clean up source directory — orderly_cleanup","text":"file deletion, look remove empty directories; orderly2 similar semantics git directories never directly tracked. recent gert (yet CRAN) ask git files ignored; ignored good candidates deletion! encourage keep per-report .gitignore lists files copy source directory, can use information clean files generation. Importantly, even file matches ignore rule committed repository, longer match ignore rule.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_cleanup.html","id":"notes-for-user-of-orderly-","dir":"Reference","previous_headings":"","what":"Notes for user of orderly1","title":"Clean up source directory — orderly_cleanup","text":"orderly1 function quite different semantics, full set possible files always knowable yaml file. , start point view list files compare directory.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_cleanup.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Clean up source directory — orderly_cleanup","text":"","code":"# Create a simple example: path <- orderly2::orderly_example(\"default\") #> ✔ Created orderly root at '/tmp/RtmpD3H7Zj/file18d78bd15f9' # We simulate running a packet interactively by using 'source'; # you might have run this line-by-line, or with the \"Source\" # button in Rstudio. source(file.path(path, \"src/data/orderly.R\"), chdir = TRUE) #> Warning: cannot open file '/tmp/RtmpD3H7Zj/file18d78bd15f9/src/data/orderly.R': No such file or directory #> Error in file(filename, \"r\", encoding = encoding): cannot open the connection # Having run this, the output of the report is present in the # source directory: fs::dir_tree(path) #> Error: [ENOENT] Failed to search directory '/tmp/RtmpD3H7Zj/file18d78bd15f9': no such file or directory # We can detect what might want cleaning up by running # \"orderly_cleanup_status\": orderly2::orderly_cleanup_status(\"data\", root = path) #> Error: Directory does not exist: '/tmp/RtmpD3H7Zj/file18d78bd15f9' # Soon this will print more nicely to the screen, but for now you # can see that the status of \"data.rds\" is \"derived\", which means # that orderly knows that it is subject to being cleaned up; the # \"delete\" element shows what will be deleted. # Do the actual deletion: orderly2::orderly_cleanup(\"data\", root = path) #> Error: Directory does not exist: '/tmp/RtmpD3H7Zj/file18d78bd15f9'"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config.html","id":null,"dir":"Reference","previous_headings":"","what":"Read configuration — orderly_config","title":"Read configuration — orderly_config","text":"Read current orderly configuration, stored within outpack root, along orderly-specific extensions.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read configuration — orderly_config","text":"","code":"orderly_config(root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read configuration — orderly_config","text":"root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read configuration — orderly_config","text":"list configuration options: core: important options outpack store, containing: path_archive: path human-readable packet archive, NULL disabled (set orderly_config_set core.path_archive) use_file_store: Indicates content-addressable file store enabled (core.use_file_store) require_complete_tree: Indicates outpack store requires dependencies fully available (core.require_complete_tree) hash_algorithm: hash algorithm used (currently modifiable) location: Information locations; see orderly_location_add, orderly_location_rename orderly_location_remove interact configuration, orderly_location_list simply list available locations. Returns data.frame columns name, id, priority, type args, args list column. orderly: list orderly-specific configuration; just minimum required version (minimum_orderly_version).","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read configuration — orderly_config","text":"","code":"# A default configuration in a new temporary directory path <- withr::local_tempdir() orderly2::orderly_init(path) #> ✔ Created orderly root at '/tmp/RtmpD3H7Zj/file18d77805949d' orderly2::orderly_config(path) #> $core #> $core$path_archive #> [1] \"archive\" #> #> $core$use_file_store #> [1] FALSE #> #> $core$require_complete_tree #> [1] FALSE #> #> $core$hash_algorithm #> [1] \"sha256\" #> #> #> $location #> name type args #> 1 local local #> #> $orderly #> $orderly$minimum_orderly_version #> [1] ‘1.99.0’ #> #>"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config_set.html","id":null,"dir":"Reference","previous_headings":"","what":"Set configuration options — orderly_config_set","title":"Set configuration options — orderly_config_set","text":"Set configuration options. can currently set; expanded time. See Details.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config_set.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set configuration options — orderly_config_set","text":"","code":"orderly_config_set(..., options = list(...), root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config_set.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set configuration options — orderly_config_set","text":"... Named options set (e.g., pass argument core.require_complete_tree = TRUE) options alternative ..., can pass list named options (e.g., list(core.require_complete_tree = TRUE)). interface typically easier program . root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config_set.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set configuration options — orderly_config_set","text":"Nothing","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config_set.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set configuration options — orderly_config_set","text":"Options set order provided. Currently, setting one option fails, options processed previous ones (rely behaviour, may change). Currently can set: core.require_complete_tree See orderly_init description options.","code":""},{"path":[]},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config_set.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set configuration options — orderly_config_set","text":"","code":"# The default configuration does not include a file store, and # saves output within the \"archive\" directory: path <- withr::local_tempdir() orderly2::orderly_init(path) #> ✔ Created orderly root at '/tmp/RtmpD3H7Zj/file18d73e87175d' fs::dir_tree(path, all = TRUE) #> /tmp/RtmpD3H7Zj/file18d73e87175d #> ├── .outpack #> │ ├── config.json #> │ ├── location #> │ └── metadata #> └── orderly_config.yml # Change this after the fact: orderly2::orderly_config_set(core.use_file_store = TRUE, core.path_archive = NULL, root = path) fs::dir_tree(path, all = TRUE) #> /tmp/RtmpD3H7Zj/file18d73e87175d #> ├── .outpack #> │ ├── config.json #> │ ├── files #> │ ├── index #> │ │ └── outpack.rds #> │ ├── location #> │ └── metadata #> └── orderly_config.yml"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_copy_files.html","id":null,"dir":"Reference","previous_headings":"","what":"Copy files from a packet — orderly_copy_files","title":"Copy files from a packet — orderly_copy_files","text":"Copy files packet anywhere. Similar orderly_dependency except used active packet context. can use function pull files outpack root directory outside control outpack, example. Note arguments need must provided name, position, exception id query.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_copy_files.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Copy files from a packet — orderly_copy_files","text":"","code":"orderly_copy_files( ..., files, dest, overwrite = TRUE, envir = parent.frame(), options = NULL, root = NULL, locate = TRUE )"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_copy_files.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Copy files from a packet — orderly_copy_files","text":"... Arguments passed orderly_query, perhaps just query expression files Files copy packet. can (1) character vector, case files copied without changing names, (2) named character vector, case name used destination name, (3) data.frame (including tbl_df, data.frame objects) containing columns , case files copied names . cases, want import directory files packet, must refer source trailing slash (e.g., c(= \"/\")), create local directory /... files upstream packet directory /. omit slash error thrown suggesting add slash intended. can use limited form string interpolation names argument; using ${variable} pick values envir substitute string. similar interpolation might familiar glue::glue similar, much simpler concatenation fancy features supported. Note unfortunate, (us) avoidable inconsistency ; interpolation values environment query done using environment:x destination filename ${x}. dest directory copy overwrite Overwrite files destination; typically want, set FALSE prefer error thrown destination file already exists. envir Optionally, environment substitute query (using environment: prefix). default use calling environment, can explicitly pass want control lookup happens. options Optionally, orderly_search_options object controlling search performed, packets considered scope. provided, default options used (.e., orderly2::orderly_search_options()) root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_copy_files.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Copy files from a packet — orderly_copy_files","text":"Nothing, invisibly. Primarily called side effect copying files packet directory dest","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_copy_files.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Copy files from a packet — orderly_copy_files","text":"can call function id string, case search packet proceed regardless whether id present. called arguments (e.g., string match id format, named argument name, subquery parameters) interpret arguments query orderly_search find id. error query return exactly one packet id, probably want use latest(). different ways might fail (recover failure): id known metadata store (known unpacked also known present remote) fail impossible resolve files. Consider refreshing metadata orderly_location_pull_metadata refresh . id unpacked local copy files referred can found, error default (see next option). However, sometimes file refer might also present downloaded packet depended , content file unchanged packet version locally. id unpacked, local copy file allow_remote TRUE try request file whatever remote selected orderly_location_pull_packet packet. Note empty directories might created failure.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_dependency.html","id":null,"dir":"Reference","previous_headings":"","what":"Declare a dependency — orderly_dependency","title":"Declare a dependency — orderly_dependency","text":"Declare dependency another packet","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_dependency.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Declare a dependency — orderly_dependency","text":"","code":"orderly_dependency(name, query, files)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_dependency.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Declare a dependency — orderly_dependency","text":"name name packet depend query query search ; often simply string latest, indicating recent version. may want complex query though. files Files copy packet. can (1) character vector, case files copied without changing names, (2) named character vector, case name used destination name, (3) data.frame (including tbl_df, data.frame objects) containing columns , case files copied names . cases, want import directory files packet, must refer source trailing slash (e.g., c(= \"/\")), create local directory /... files upstream packet directory /. omit slash error thrown suggesting add slash intended. can use limited form string interpolation names argument; using ${variable} pick values envir substitute string. similar interpolation might familiar glue::glue similar, much simpler concatenation fancy features supported. Note unfortunate, (us) avoidable inconsistency ; interpolation values environment query done using environment:x destination filename ${x}.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_dependency.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Declare a dependency — orderly_dependency","text":"Undefined","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_dependency.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Declare a dependency — orderly_dependency","text":"See orderly_run details search options used select locations packets found , data fetched network. running interactively, obviously work, use orderly_interactive_set_search_options() set options function respond .","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_description.html","id":null,"dir":"Reference","previous_headings":"","what":"Describe the current packet — orderly_description","title":"Describe the current packet — orderly_description","text":"Describe current packet","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_description.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Describe the current packet — orderly_description","text":"","code":"orderly_description(display = NULL, long = NULL, custom = NULL)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_description.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Describe the current packet — orderly_description","text":"display friendly name report; displayed locations web interface, packit. given, must scalar character. long longer description report. given, must scalar character. custom additional metadata. given, must named list, elements scalar atomics (character, number, logical).","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_description.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Describe the current packet — orderly_description","text":"Undefined","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_example.html","id":null,"dir":"Reference","previous_headings":"","what":"Copy a simple orderly example — orderly_example","title":"Copy a simple orderly example — orderly_example","text":"Copy simple orderly example use docs. function form part workflow!","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_example.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Copy a simple orderly example — orderly_example","text":"","code":"orderly_example(name, ..., dest = NULL)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_example.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Copy a simple orderly example — orderly_example","text":"name name example copy. Currently \"default\" supported. ... Arguments passed orderly_init() dest destination. default use withr::local_tempfile() create temporary directory clean . suitable use orderly examples, may prefer provide path. path must already exist.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_example.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Copy a simple orderly example — orderly_example","text":"Invisibly, path example.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_example.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Copy a simple orderly example — orderly_example","text":"","code":"path <- orderly2::orderly_example(\"default\") #> ✔ Created orderly root at '/tmp/RtmpD3H7Zj/file18d73ac80ebb' orderly2::orderly_list_src(root = path) #> Error: Directory does not exist: '/tmp/RtmpD3H7Zj/file18d73ac80ebb'"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_gitignore_update.html","id":null,"dir":"Reference","previous_headings":"","what":"Update a gitignore file — orderly_gitignore_update","title":"Update a gitignore file — orderly_gitignore_update","text":"Update gitignore, useful prevent accidentally committing files source control generated. includes artefacts, shared resources dependencies (within report directory) global level contents .outpack directory, draft folder archive directory.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_gitignore_update.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update a gitignore file — orderly_gitignore_update","text":"","code":"orderly_gitignore_update(name, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_gitignore_update.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update a gitignore file — orderly_gitignore_update","text":"name name gitignore file update, string \"(root)\" root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, just outpack (see orderly_init details). locate Logical, indicating configuration searched . TRUE config given, orderly looks working directory parents finds .outpack directory","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_gitignore_update.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Update a gitignore file — orderly_gitignore_update","text":"Nothing, called side effects","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_gitignore_update.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Update a gitignore file — orderly_gitignore_update","text":"function fails message edit '.gitignore', markers corrupted, look special markers within .gitignore file. look like edit file : lines appears file anything first two lines order get error message, search remove lines rerun.","code":"# ---VVV--- added by orderly ---VVV---------------- # Don't manually edit content between these markers ... patterns # ---^^^--- added by orderly ---^^^----------------"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_hash.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute a hash — orderly_hash_file","title":"Compute a hash — orderly_hash_file","text":"Use orderly2's hashing functions. intended advanced users, particular want create hashes consistent orderly2 within plugins. default behaviour use algorithm used orderly root (via root argument, usual root location approach). However, string provided algorithm can use alternative algorithm.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_hash.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute a hash — orderly_hash_file","text":"","code":"orderly_hash_file(path, algorithm = NULL, root = NULL, locate = TRUE) orderly_hash_data(data, algorithm = NULL, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_hash.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute a hash — orderly_hash_file","text":"path name file hash algorithm name algorithm use, overriding orderly root. root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml data string hash","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_hash.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute a hash — orderly_hash_file","text":"string format :","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_hash.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute a hash — orderly_hash_file","text":"","code":"orderly2::orderly_hash_data(\"hello\", \"md5\") #> [1] \"md5:5d41402abc4b2a76b9719d911017c592\""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_init.html","id":null,"dir":"Reference","previous_headings":"","what":"Initialise an orderly repository — orderly_init","title":"Initialise an orderly repository — orderly_init","text":"Initialise empty orderly repository, initialise source copy orderly repository (see Details). orderly repository defined presence file orderly_config.yml root, along directory .outpack/ level.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_init.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Initialise an orderly repository — orderly_init","text":"","code":"orderly_init( path, path_archive = \"archive\", use_file_store = FALSE, require_complete_tree = FALSE )"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_init.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Initialise an orderly repository — orderly_init","text":"path path initialise repository . repository already initialised, operation nothing. path_archive Path archive directory, used store human-readable copies packets. NULL, copy made, file_store must TRUE use_file_store Logical, indicating use content-addressable file-store source truth packets. archive non-NULL, file-store used source truth duplicated files archive exist convenience. require_complete_tree Logical, indicating require complete tree packets. currently affects orderly_location_pull_packet, requiring always operates recursive mode. FALSE default, set TRUE want archive behave well location; TRUE always packets hold metadata .","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_init.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Initialise an orderly repository — orderly_init","text":"full, normalised, path root, invisibly. Typically called side effect.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_init.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Initialise an orderly repository — orderly_init","text":"expected orderly_config.yml saved version control, .outpack excluded version control; means every clone project need call orderly2::orderly_init() initialise .outpack directory. forget , error thrown reminding need . can safely call orderly2::orderly_init() already-initialised directory, however, arguments passed must exactly match configuration current root, otherwise error thrown. Please use orderly_config_set change configuration, ensures change configuration possible. configuration options given match directory already uses, nothing happens. repository call orderly2::orderly_init() already initialised .outpack directory orderly_config.yml file, write file .","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_init.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Initialise an orderly repository — orderly_init","text":"","code":"# We'll use an automatically cleaned-up directory for the root: path <- withr::local_tempdir() # Initialise a new repository, setting an option: orderly2::orderly_init(path, use_file_store = TRUE) #> ✔ Created orderly root at '/tmp/RtmpD3H7Zj/file18d722a2563' # fs::dir_tree(path, all = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_interactive_set_search_options.html","id":null,"dir":"Reference","previous_headings":"","what":"Set search options for interactive use — orderly_interactive_set_search_options","title":"Set search options for interactive use — orderly_interactive_set_search_options","text":"Set search options interactive use orderly; see orderly_dependency orderly_run details. may either orderly_search_options object, list coerced one point use (NULL). applies current session, applies interactive uses orderly functions might received copy search_options via orderly_run","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_interactive_set_search_options.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set search options for interactive use — orderly_interactive_set_search_options","text":"","code":"orderly_interactive_set_search_options(options = NULL)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_interactive_set_search_options.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set search options for interactive use — orderly_interactive_set_search_options","text":"options Optional control locations, used orderly_dependency; see Details section orderly_run.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_interactive_set_search_options.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set search options for interactive use — orderly_interactive_set_search_options","text":"Nothing, called side effects","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_list_src.html","id":null,"dir":"Reference","previous_headings":"","what":"List source reports — orderly_list_src","title":"List source reports — orderly_list_src","text":"List source reports - , directories within src/ contain file orderly.R","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_list_src.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List source reports — orderly_list_src","text":"","code":"orderly_list_src(root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_list_src.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List source reports — orderly_list_src","text":"root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, just outpack (see orderly_init details). locate Logical, indicating configuration searched . TRUE config given, orderly looks working directory parents finds .outpack directory","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_list_src.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List source reports — orderly_list_src","text":"character vector names source reports, suitable passing orderly_run","code":""},{"path":[]},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_list_src.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"List source reports — orderly_list_src","text":"","code":"path <- orderly2::orderly_example(\"default\") #> ✔ Created orderly root at '/tmp/RtmpD3H7Zj/file18d74f64c136' orderly2::orderly_list_src(root = path) #> Error: Directory does not exist: '/tmp/RtmpD3H7Zj/file18d74f64c136'"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_add.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a new location — orderly_location_add","title":"Add a new location — orderly_location_add","text":"Add new location - place packets might found pulled local archive. Currently file http based locations supported, limited support custom locations. Note adding location pull metadata , need call orderly_location_pull_metadata first.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_add.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a new location — orderly_location_add","text":"","code":"orderly_location_add(name, type, args, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_add.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a new location — orderly_location_add","text":"name short name location use. use, one local orphan type type location add. Currently supported values path (location exists elsewhere filesystem) http (location accessed outpack's http API). args Arguments location driver. arguments vary depending type used, see Details. root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_add.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a new location — orderly_location_add","text":"Nothing","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_add.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add a new location — orderly_location_add","text":"currently support two types locations - path, points outpack archive accessible path (e.g., computer mounted network share) http, requires outpack server running url uses HTTP API communicate. types may added later, configuration options location types definitely needed future. Configuration options different location types: Path locations: path: path archive root. generally absolute path, behaviour outpack unreliable. HTTP locations: Accessing outpack HTTP requires outpack server running. interface expected change expand API, also move support things like TLS authentication. url: location server, including protocol, example http://example.com:8080 Custom locations: outpack implementations expected support path http locations, standard arguments . expect implementations support custom locations, argument lists may vary implementations. allow , can pass location type \"custom\" list arguments. expect argument 'driver' present among list. example action, see outpack.sharepoint package. warned may change interface future, case may need update configuration.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_add.html","id":"warning","dir":"Reference","previous_headings":"","what":"Warning","title":"Add a new location — orderly_location_add","text":"API may change move support different types locations.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_list.html","id":null,"dir":"Reference","previous_headings":"","what":"List known pack locations — orderly_location_list","title":"List known pack locations — orderly_location_list","text":"List known locations.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List known pack locations — orderly_location_list","text":"","code":"orderly_location_list(root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List known pack locations — orderly_location_list","text":"root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List known pack locations — orderly_location_list","text":"character vector location names. special name local always present.","code":""},{"path":[]},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_pull_metadata.html","id":null,"dir":"Reference","previous_headings":"","what":"Pull metadata from a location — orderly_location_pull_metadata","title":"Pull metadata from a location — orderly_location_pull_metadata","text":"Pull metadata location, updating index. always relatively quick updates small files contain information can found remote packets.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_pull_metadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pull metadata from a location — orderly_location_pull_metadata","text":"","code":"orderly_location_pull_metadata(location = NULL, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_pull_metadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pull metadata from a location — orderly_location_pull_metadata","text":"location name location pull (see orderly_location_list possible values). given, pulls locations. \"local\" \"orphan\" locations always date pulling metadata nothing. root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_pull_metadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pull metadata from a location — orderly_location_pull_metadata","text":"Nothing","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_pull_packet.html","id":null,"dir":"Reference","previous_headings":"","what":"Pull a single packet from a location — orderly_location_pull_packet","title":"Pull a single packet from a location — orderly_location_pull_packet","text":"Pull one packets (including files) archive one locations. make files available use dependencies (e.g., orderly_dependency).","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_pull_packet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pull a single packet from a location — orderly_location_pull_packet","text":"","code":"orderly_location_pull_packet( ..., options = NULL, recursive = NULL, root = NULL, locate = TRUE )"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_pull_packet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pull a single packet from a location — orderly_location_pull_packet","text":"... Arguments passed orderly_search. special case first argument character vector ids named dot arguments, interpret argument vector ids directly. careful , query may pull lot data particular, passing NULL match everything every remote ! options Options passed orderly_search. option allow_remote must TRUE otherwise packet possibly pulled, error thrown FALSE. recursive non-NULL, logical, indicating recursively pull packets referenced packets specified id. might copy lot data! NULL, default value given configuration option require_complete_tree. root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_pull_packet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pull a single packet from a location — orderly_location_pull_packet","text":"Invisibly, ids packets pulled","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_pull_packet.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Pull a single packet from a location — orderly_location_pull_packet","text":"possible take long time pull packets, moving lot data operating slow connection. Cancelling resuming pull fairly efficient, keep track files copied even case interrupted pull.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_push.html","id":null,"dir":"Reference","previous_headings":"","what":"Push tree to location — orderly_location_push","title":"Push tree to location — orderly_location_push","text":"Push tree location. function works packets known location files required create . pushes files required build packets pushes missing metadata server. process interrupted safe resume transfer files packets missed previous call.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_push.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Push tree to location — orderly_location_push","text":"","code":"orderly_location_push(packet_id, location, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_push.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Push tree to location — orderly_location_push","text":"packet_id One packets push server location name location push (see orderly_location_list possible values). root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_push.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Push tree to location — orderly_location_push","text":"Invisibly, details information actually moved (might less requested, depending dependencies packets already known location).","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_remove.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove a location — orderly_location_remove","title":"Remove a location — orderly_location_remove","text":"Remove existing location. packets location known elsewhere now associated 'orphan' location instead.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_remove.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove a location — orderly_location_remove","text":"","code":"orderly_location_remove(name, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_remove.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove a location — orderly_location_remove","text":"name short name location. remove local orphan root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_remove.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove a location — orderly_location_remove","text":"Nothing","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_rename.html","id":null,"dir":"Reference","previous_headings":"","what":"Rename a location — orderly_location_rename","title":"Rename a location — orderly_location_rename","text":"Rename existing location","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_rename.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rename a location — orderly_location_rename","text":"","code":"orderly_location_rename(old, new, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_rename.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rename a location — orderly_location_rename","text":"old current short name location. rename local orphan new desired short name location. one local orphan root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_rename.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Rename a location — orderly_location_rename","text":"Nothing","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata.html","id":null,"dir":"Reference","previous_headings":"","what":"Read outpack metadata — orderly_metadata","title":"Read outpack metadata — orderly_metadata","text":"Read metadata particular id. may want use orderly_search find id corresponding particular query.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read outpack metadata — orderly_metadata","text":"","code":"orderly_metadata(id, root = NULL, locate = FALSE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read outpack metadata — orderly_metadata","text":"id id fetch metadata . error thrown id known root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read outpack metadata — orderly_metadata","text":"list metadata. See outpack schema details (https://github.com/mrc-ide/outpack)","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_extract.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract metadata from orderly2 packets — orderly_metadata_extract","title":"Extract metadata from orderly2 packets — orderly_metadata_extract","text":"Extract metadata group packets. experimental high-level function interacting metadata way hope useful. expand bit time goes , based feedback get let us know think. See Details use .","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_extract.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract metadata from orderly2 packets — orderly_metadata_extract","text":"","code":"orderly_metadata_extract(..., extract = NULL, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_extract.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract metadata from orderly2 packets — orderly_metadata_extract","text":"... Arguments passed orderly_search. special case first argument character vector ids named dot arguments, interpret argument vector ids directly. extract character vector columns extract, possibly named. See Details format. root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_extract.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract metadata from orderly2 packets — orderly_metadata_extract","text":"data.frame, columns vary based names extract; see Details information.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_extract.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extract metadata from orderly2 packets — orderly_metadata_extract","text":"Extracting data outpack metadata challenging way works data structures familiar R users, naturally tree structured, metadata may present packets (e.g., packet depend another dependency section, one run context without git git metadata). just want raw tree-structured data, can always use orderly_metadata load full metadata packet (even one currently available computer, just known ) structure data remain fairly constant across orderly2 versions. However, sometimes want extract data order ask specific questions like: parameter combinations available across range packets? particular set packets used? files packets produce? Later like ask even complex questions like: version file graph.png change? inputs changed versions? ...able answer questions requires similar approach interrogating metadata across range packets. orderly_metadata_extract function aims simplify process pulling bits metadata arranging data.frame (sorts) . little mini-language extract argument simple rewriting results, can always . order use function need know metadata available; expand vignette worked examples make easier understand. function works top-level keys, : id: packet id (always returned) name: packet name parameters: key-value pair values, string keys atomic values. guarantee presence keys packets, types. time: key-value pair times, string keys time values (see DateTimeClasses; stored seconds since 1970 actual metadata). present start end always present. files: files present packet. data.frame (per packet), columns path (relative), size (bytes) hash. depends: dependencies used packet. data.frame (per packet), columns packet (id), query (string, used find packet) files (another data.frame columns corresponding filenames upstream packet, respectively) git: either metadata state git null. given sha branch strings, url array strings/character vector (can zero, one elements). session: information session packet run (unstandardised, even orderly version may change) custom: additional metadata added respective engine. packets run orderly2, orderly field , list: artefacts: data.frame artefact information, containing columns description (string) paths (list column paths). shared: data.frame copied shared resources original name () name copied packet (). role: data.frame identified roles files, columns path role. description: list information orderly_description human-readable descriptions tags. session: list information session run, list platform containing information platform (R version version, operating system os system name system) packages containing columns package , version attached. nesting makes providing universally useful data format difficult; considering files data.frame files column, list data.frames; similar nestedness applies depends orderly custom data. However, able fairly easily process data format need . simplest extraction uses names top-level keys: creates data.frame columns corresponding keys, one row per packet. name always string, character vector, parameters files complex, list columns. must provide id; always returned always first character vector column. can rename columns providing name entries within extract, example: , except parameters column renamed pars. interestingly, can index structure like parameters; suppose want value parameter x, write: allowed packet parameters element list. However, know type x (might vary packets). can add information though write: create numeric column. packet value x non-integer, call orderly_metadata_extract fail error, packet lacks value x, missing value appropriate type added. Note coercion number, error non-NULL non-numeric value found. Valid types use boolean, number string (note differ slightly R's names want emphasise scalar quantities; also note integer may produce unexpected errors integer-like numeric values). can also use list default. Things schema known scalar atomics (name) automatically simplified. can index array-valued elements (files depends) way object-valued elements: get list column file names per packet another hashes, probably less useful data.frame get extracting just files longer hash information aligned. can index fairly deeply; possible get orderly \"display name\" : path need extract dot (likely package name plugin, custom.orderly.db) need escape dot backslash (, custom.orderly\\.db). probably need two slashes use raw string (recent versions R).","code":"extract = c(\"name\", \"parameters\", \"files\") extract = c(\"name\", pars = \"parameters\", \"files\") extract = c(x = \"parameters.x\") extract = c(x = \"parameters.x is number\") extract = c(file_path = \"files.path\", file_hash = \"files.hash\") extract = c(display = \"custom.orderly.description.display is string\")"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_extract.html","id":"custom-orderly-metadata","dir":"Reference","previous_headings":"","what":"Custom 'orderly' metadata","title":"Extract metadata from orderly2 packets — orderly_metadata_extract","text":"Within custom.orderly, additional fields can extracted. format subject change, stored metadata schema (short term) way deserialise . probably best rely right now, expand section can.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_read.html","id":null,"dir":"Reference","previous_headings":"","what":"Read outpack metadata json file — orderly_metadata_read","title":"Read outpack metadata json file — orderly_metadata_read","text":"Low-level function reading metadata deserialising . function can used directly read metadata json file without reference root contains . may useful context reading metadata file written part failed run.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_read.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read outpack metadata json file — orderly_metadata_read","text":"","code":"orderly_metadata_read(path)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_read.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read outpack metadata json file — orderly_metadata_read","text":"path Path json file","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_read.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read outpack metadata json file — orderly_metadata_read","text":"list outpack metadata; see schema details. contrast reading json file directly jsonlite::fromJSON, function take care convert scalar length-one vectors expected types.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_new.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a new report — orderly_new","title":"Create a new report — orderly_new","text":"Create new empty report.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_new.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a new report — orderly_new","text":"","code":"orderly_new(name, template = NULL, force = FALSE, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_new.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a new report — orderly_new","text":"name name report template template use. acceptable values now NULL (uses built-default) FALSE suppresses default content. may support customisable templates future - let us know useful. force Create orderly.R file within existing directory src/; may useful already created directory files first want help creating orderly file. root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, just outpack (see orderly_init details). locate Logical, indicating configuration searched . TRUE config given, orderly looks working directory parents finds .outpack directory","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_new.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a new report — orderly_new","text":"Nothing, called side effects ","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Declare orderly parameters — orderly_parameters","title":"Declare orderly parameters — orderly_parameters","text":"Declare orderly parameters. one call within file, though enforced! Typically put close top, though order really matter. Parameters scalar atomic values (e.g. string, number boolean) defaults must present literally (.e., may come variable ). Provide NULL default, case parameter required.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Declare orderly parameters — orderly_parameters","text":"","code":"orderly_parameters(...)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Declare orderly parameters — orderly_parameters","text":"... number parameters","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_parameters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Declare orderly parameters — orderly_parameters","text":"Undefined","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_parameters.html","id":"behaviour-in-interactive-sessions","dir":"Reference","previous_headings":"","what":"Behaviour in interactive sessions","title":"Declare orderly parameters — orderly_parameters","text":"running interactively (.e., via source() running orderly.R session copy/paste Rstudio), orderly_parameters() function different behaviour. First, look current environment (likely global environment) values parameters - , variables bound names parameters. parameters found look default values use possible, possible either error prompt based global option orderly_interactive_parameters_missing_error. TRUE, ask enter value parameters (strings need entered quotes).","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_add_metadata.html","id":null,"dir":"Reference","previous_headings":"","what":"Add metadata from plugin — orderly_plugin_add_metadata","title":"Add metadata from plugin — orderly_plugin_add_metadata","text":"Add plugin-specific metadata running packet. take describing. accumulate number bits metadata arbitrary fields, later serialise json.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_add_metadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add metadata from plugin — orderly_plugin_add_metadata","text":"","code":"orderly_plugin_add_metadata(name, field, data)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_add_metadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add metadata from plugin — orderly_plugin_add_metadata","text":"name name plugin; must used orderly_plugin_register orderly_plugin_context field name field add data . required even plugin produces one sort data, case can remove later within serialisation function. data Arbitrary data added currently running packet","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_add_metadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add metadata from plugin — orderly_plugin_add_metadata","text":"Nothing, called side effects","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_context.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch plugin context — orderly_plugin_context","title":"Fetch plugin context — orderly_plugin_context","text":"Fetch running context, use within plugin. intention within free functions plugin makes available, call function get information state packet. typically call orderly_plugin_add_metadata() afterwards.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_context.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch plugin context — orderly_plugin_context","text":"","code":"orderly_plugin_context(name, envir)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_context.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch plugin context — orderly_plugin_context","text":"name Name plugin envir environment calling function. can typically pass parent.frame() (rlang::caller_env()) function calling orderly_plugin_context() function called user. argument effect interactive use (envir almost certainly global environment).","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_context.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fetch plugin context — orderly_plugin_context","text":"list elements: is_active: logical, indicating running orderly_run(); may need change behaviour depending value. path: path running packet. almost always working directory, unless packet contains calls setwd() similar. may create files . config: configuration plugin, processing plugin's read function (see orderly_plugin_register) envir: environment packet running . Often global environment, assume ! may read write environment. src: path packet source directory. different current directory packet running, user interactively working report. may read directory must write parameters: parameters passed run report.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_context.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fetch plugin context — orderly_plugin_context","text":"plugin function called, orderly2 running one two modes; (1) within orderly_run(), case part way creating packet brand new directory, possibly using special environment evaluation, (2) interactively, user developing report. plugin needs able support modes, function return information state help cope either case.","code":""},{"path":[]},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_register.html","id":null,"dir":"Reference","previous_headings":"","what":"Register an orderly plugin — orderly_plugin_register","title":"Register an orderly plugin — orderly_plugin_register","text":"Create orderly plugin. plugin typically defined package used extend orderly enabling new functionality, declared orderly_config.yml orderly.R affecting running reports primarily creating new objects report environment. system discussed detail vignette(\"plugins\"), expanded (likely breaking ways) soon.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_register.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Register an orderly plugin — orderly_plugin_register","text":"","code":"orderly_plugin_register( name, config, serialise = NULL, cleanup = NULL, schema = NULL )"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_register.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Register an orderly plugin — orderly_plugin_register","text":"name name plugin, typically package name config function read, check process configuration section orderly_config.yml. function passed deserialised data plugin's section orderly_config.yml, full path file. order loading plugins defined, plugin must standalone try interact plugins load. return processed copy configuration data, passed second argument read. serialise function serialise metadata added plugin's functions outpack metadata. passed list entries pushed via orderly_plugin_add_metadata(); named list names corresponding field argument orderly_plugin_add_metadata list element unnamed list values corresponding data. NULL, serialisation done, metadata plugin added. cleanup Optionally, function clean state plugin uses. can call orderly_plugin_context within function access anything need . given, cleanup done. schema Optionally path, within package, schema metadata created plugin; omit .json extension. file contains sources file inst/plugin/myschema.json pass plugin/myschema. See vignette(\"plugins\") details.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_register.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Register an orderly plugin — orderly_plugin_register","text":"Nothing, function called side effect registering plugin.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_prune_orphans.html","id":null,"dir":"Reference","previous_headings":"","what":"Prune orphan packet metadata — orderly_prune_orphans","title":"Prune orphan packet metadata — orderly_prune_orphans","text":"Prune orphan packets metadata store. function can used remove references packets longer reachable; happened deleted packet manually archive ran orderly_validate_archive removed location.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_prune_orphans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prune orphan packet metadata — orderly_prune_orphans","text":"","code":"orderly_prune_orphans(root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_prune_orphans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prune orphan packet metadata — orderly_prune_orphans","text":"root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_prune_orphans.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Prune orphan packet metadata — orderly_prune_orphans","text":"Invisibly, character vector orphaned packet ids","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_prune_orphans.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Prune orphan packet metadata — orderly_prune_orphans","text":"orphan packet used anywhere, can easily drop - never existed. referenced metadata know elsewhere locally, problem upstream location (one happen). referenced packet run locally, metadata deleted. expose function mostly users want expunge permanently reference previously run packets. hope never need really reason run .","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_query.html","id":null,"dir":"Reference","previous_headings":"","what":"Construct outpack query — orderly_query","title":"Construct outpack query — orderly_query","text":"Construct outpack query, typically passed orderly_search","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_query.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Construct outpack query — orderly_query","text":"","code":"orderly_query(expr, name = NULL, scope = NULL, subquery = NULL)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_query.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Construct outpack query — orderly_query","text":"expr query expression. NULL expression matches everything. name Optionally, name packet scope query . intersected scope arg shorthand way running scope = list(name = \"name\") scope Optionally, scope query limit packets searched pars subquery Optionally, named list subqueries can referenced name expr.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_query.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Construct outpack query — orderly_query","text":"orderly_query object, modified, can passed orderly_search()","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_query_explain.html","id":null,"dir":"Reference","previous_headings":"","what":"Explain a query — orderly_query_explain","title":"Explain a query — orderly_query_explain","text":"Explain query matched. experimental output change. moment, can tell query matches, fails match based one number &&-ed together clauses.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_query_explain.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Explain a query — orderly_query_explain","text":"","code":"orderly_query_explain( ..., parameters = NULL, envir = parent.frame(), options = NULL, root = NULL )"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_query_explain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Explain a query — orderly_query_explain","text":"... Arguments passed orderly_query, perhaps just query expression parameters Optionally, named list parameters substitute query (using : prefix) envir Optionally, environment substitute query (using environment: prefix). default use calling environment, can explicitly pass want control lookup happens. options Optionally, orderly_search_options object controlling search performed, packets considered scope. provided, default options used (.e., orderly2::orderly_search_options()) root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details).","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_query_explain.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Explain a query — orderly_query_explain","text":"object class orderly_query_explain, can inspected (contents subject change) print method show user-friendly summary query result.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_resource.html","id":null,"dir":"Reference","previous_headings":"","what":"Declare orderly resources — orderly_resource","title":"Declare orderly resources — orderly_resource","text":"Declare file, group files, orderly resource. explicitly declaring files resources orderly mark files immutable inputs validate analysis modify run orderly_run()","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_resource.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Declare orderly resources — orderly_resource","text":"","code":"orderly_resource(files)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_resource.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Declare orderly resources — orderly_resource","text":"files number names files","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_resource.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Declare orderly resources — orderly_resource","text":"Invisibly, character vector resources included call. rely order files expanded directories, likely platform dependent.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run.html","id":null,"dir":"Reference","previous_headings":"","what":"Run a report — orderly_run","title":"Run a report — orderly_run","text":"Run report. create new directory drafts/, copy declared resources , run script check expected artefacts created.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run a report — orderly_run","text":"","code":"orderly_run( name, parameters = NULL, envir = NULL, echo = TRUE, search_options = NULL, root = NULL, locate = TRUE, root_src = NULL )"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run a report — orderly_run","text":"name Name report run. leading ./ src/ trailing / path parts removed (e.g., added autocomplete). parameters Parameters passed report. named list parameters declared orderly.yml. parameter must scalar character, numeric, integer logical. envir environment used evaluate report script; default use global environment, may always wanted. echo Optional logical control printing output source() console. search_options Optional control locations, used orderly_dependency; converted orderly_search_options object, see Details. root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, just outpack (see orderly_init details). locate Logical, indicating configuration searched . TRUE config given, orderly looks working directory parents finds .outpack directory root_src Separately, root orderly source tree, separate outpack root (given root). intended running reports situations source tree kept different place outpack root; see Details information.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Run a report — orderly_run","text":"id created report (string)","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run.html","id":"locations-used-in-dependency-resolution","dir":"Reference","previous_headings":"","what":"Locations used in dependency resolution","title":"Run a report — orderly_run","text":"packet depends packets, want control locations used find appropriate packets. control passed function argument orderly_dependency property way packet created packet ; importantly different users may different names locations makes little sense encode location name source code. Alternatively, want use different locations different contexts (initial development want include local copies packets possible dependencies vs resolving dependencies resolved one locations! Similarly, might want include packets known locations currently downloaded onto machine - pulling packets take anything seconds hours depending size speed network connection (pulling packets mean packet fails run). allow control can pass argument search_options, orderly_search_options object, allows control names locations use, whether metadata refreshed pull anything packets currently downloaded considered candidates. effect running interactively, case can specify search options (root specific) orderly_interactive_set_search_options","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run.html","id":"which-packets-might-be-selected-from-locations-","dir":"Reference","previous_headings":"","what":"Which packets might be selected from locations?","title":"Run a report — orderly_run","text":"search_options argument controls outpack searches packets given query anything might moved network (one outpack archive another). default everything resolved locally ; can depend packets unpacked within current archive. pass search_options argument contains allow_remote = TRUE (see orderly_search_options packets known anywhere candidates using dependencies needed pull resolved files remote location. Note even packet locally present might needed - content anywhere else unpacked packet reuse content without re-fetching. pull_metadata = TRUE, refresh location metadata pulling, location argument controls locations pulled .","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run.html","id":"equivalence-to-the-old-use-draft-option","dir":"Reference","previous_headings":"","what":"Equivalence to the old use_draft option","title":"Run a report — orderly_run","text":"location handling generalises orderly (v1)'s old use_draft option, terms location argument orderly2::orderly_search_options`: use_draft = TRUE location = \"local\" use_draft = FALSE location = c(...) provide locations except local (setdiff(orderly2::orderly_location_list(), \"local\")) use_draft = \"newer\" location = NULL (last option one people preferred new default behaviour). addition, resolve dependencies currently exist production right now options: updates current metadata production, runs queries packets known remote, depends even (yet) locally. functionality never available orderly version 1, though intended support .","code":"location = \"production\", pull_metadata = TRUE, require_unpacked = FALSE"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run.html","id":"running-with-a-source-tree-separate-from-outpack-root","dir":"Reference","previous_headings":"","what":"Running with a source tree separate from outpack root","title":"Run a report — orderly_run","text":"Sometimes useful run things different place disk outpack root. know two cases come : running reports within runner server, make clean clone source tree particular git reference new temporary directory run report , insert orderly repo fixed non-temporary location. user convenient torun report hard drive store archive metadata (larger) shared drive. first instance, source path contains file orderly_config.yml directory src/ source reports, separate path contains directory .outpack/ metadata - may also unpacked archive, .git/ directory depending configuration. (Later make sense support \"bare\" outpack layout.)","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Run a report — orderly_run","text":"","code":"# Create a simple example: path <- orderly2::orderly_example(\"default\") #> ✔ Created orderly root at '/tmp/RtmpD3H7Zj/file18d75951b14e' # Run the 'data' task: orderly2::orderly_run(\"data\", root = path) #> Error: Directory does not exist: '/tmp/RtmpD3H7Zj/file18d75951b14e' # After running, a finished packet appears in the archive: fs::dir_tree(path) #> Error: [ENOENT] Failed to search directory '/tmp/RtmpD3H7Zj/file18d75951b14e': no such file or directory # and we can query the metadata: orderly2::orderly_metadata_extract(name = \"data\", root = path) #> Error: Directory does not exist: '/tmp/RtmpD3H7Zj/file18d75951b14e'"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run_info.html","id":null,"dir":"Reference","previous_headings":"","what":"Information about currently running report — orderly_run_info","title":"Information about currently running report — orderly_run_info","text":"Fetch information actively running report. allows reflect information report back part report, example embedding current report id, information computed dependencies. information slightly different format orderly version 1.x (currently) include information dependencies run outside orderly_run, never reliable previously.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run_info.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Information about currently running report — orderly_run_info","text":"","code":"orderly_run_info()"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run_info.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Information about currently running report — orderly_run_info","text":"list elements name: name current report id: id current report, NA running interactively root: orderly root path depends: data frame information dependencies (available interactively) index: integer sequence along calls orderly_dependency name: name dependency query: query used find dependency id: computed id included packet filename: file used packet : filename used locally","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_search.html","id":null,"dir":"Reference","previous_headings":"","what":"Query outpack's database — orderly_search","title":"Query outpack's database — orderly_search","text":"Evaluate query outpack database, returning vector matching packet ids. Note default searches packets unpacked available direct use computer; search within packets known locations (might know via metadata) need use options argument.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_search.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Query outpack's database — orderly_search","text":"","code":"orderly_search( ..., parameters = NULL, envir = parent.frame(), options = NULL, root = NULL )"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_search.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query outpack's database — orderly_search","text":"... Arguments passed orderly_query, perhaps just query expression parameters Optionally, named list parameters substitute query (using : prefix) envir Optionally, environment substitute query (using environment: prefix). default use calling environment, can explicitly pass want control lookup happens. options Optionally, orderly_search_options object controlling search performed, packets considered scope. provided, default options used (.e., orderly2::orderly_search_options()) root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details).","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_search.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Query outpack's database — orderly_search","text":"character vector matching ids. case match query returning single value (e.g., latest(...) single(...)) character missing value (NA_character_)","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_search_options.html","id":null,"dir":"Reference","previous_headings":"","what":"Packet search options — orderly_search_options","title":"Packet search options — orderly_search_options","text":"Options controlling packet searches carried , example via orderly_search orderly_run. details never included metadata alongside query (, part query even though affect ).","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_search_options.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Packet search options — orderly_search_options","text":"","code":"orderly_search_options( location = NULL, allow_remote = FALSE, pull_metadata = FALSE )"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_search_options.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Packet search options — orderly_search_options","text":"location Optional vector locations pull . might future expand allow wildcards exceptions. allow_remote Logical, indicating allow packets found currently unpacked (.e., known location metadata ). TRUE, conjunction orderly_dependency might pull large quantity data. pull_metadata Logical, indicating pull metadata immediately search. location given, pass orderly_location_pull_metadata filter locations update. pulling many packets sequence, want update option FALSE first pull.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_search_options.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Packet search options — orderly_search_options","text":"object class orderly_search_options modified creation (see note pull_metadata)","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_shared_resource.html","id":null,"dir":"Reference","previous_headings":"","what":"Copy shared resources into a packet directory — orderly_shared_resource","title":"Copy shared resources into a packet directory — orderly_shared_resource","text":"Copy shared resources packet directory. can use share common resources (data code) multiple packets. Additional metadata added keep track files came . Using function requires shared resources directory shared/ exists orderly root; error raised configured attempt fetch files.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_shared_resource.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Copy shared resources into a packet directory — orderly_shared_resource","text":"","code":"orderly_shared_resource(...)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_shared_resource.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Copy shared resources into a packet directory — orderly_shared_resource","text":"... Named arguments corresponding shared resources copy. name destination filename, value filename within shared resource directory.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_shared_resource.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Copy shared resources into a packet directory — orderly_shared_resource","text":"Invisibly, data.frame columns (fileames copied running packet) (filenames within shared/). orderly_resource, rely ordering directory expansion performed.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_strict_mode.html","id":null,"dir":"Reference","previous_headings":"","what":"Enable orderly strict mode — orderly_strict_mode","title":"Enable orderly strict mode — orderly_strict_mode","text":"Put orderly2 \"strict mode\", closer defaults orderly 1.0.0; mode explicitly included files (via orderly_resource orderly_shared_resource) copied running packet, warn unexpected files end run. Using strict mode allows orderly2 aggressive deletes files within source directory, accurate reports , faster start packets developing interactively.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_strict_mode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Enable orderly strict mode — orderly_strict_mode","text":"","code":"orderly_strict_mode()"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_strict_mode.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Enable orderly strict mode — orderly_strict_mode","text":"Undefined","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_strict_mode.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Enable orderly strict mode — orderly_strict_mode","text":"future, may extend strict mode allow requiring computation occurs within orderly functions (.e., requirements run packet fully known actually running ). likely default behaviour orderly_strict_mode gain argument. allow server processes either override value (enabling even explicitly given) /require .","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_validate_archive.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate unpacked packets. — orderly_validate_archive","title":"Validate unpacked packets. — orderly_validate_archive","text":"Validate unpacked packets. time, expect function become fully featured, validating .","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_validate_archive.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate unpacked packets. — orderly_validate_archive","text":"","code":"orderly_validate_archive(..., action = \"inform\", root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_validate_archive.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate unpacked packets. — orderly_validate_archive","text":"... Either arguments search can constructed (useful options include name = \"something\"), character vector ids, leave empty validate everything. action action take finding invalid packet. See Details. root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_validate_archive.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate unpacked packets. — orderly_validate_archive","text":"Invisibly, character vector repaired (invalid) packets.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_validate_archive.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Validate unpacked packets. — orderly_validate_archive","text":"actions can take finding invalid packet : inform (default): just print information problem orphan: mark packet orphaned within metadata, touch files archive (default directory archive/) - safe option leave consistent state without deleting anything. delete: addition marking packet orphan, also delete files archive. Later, add \"repair\" option try fix broken packets. validation interacts option core.require_complete_tree; option TRUE, packet valid (recursive) dependencies also valid, action apply packets also upstream dependencies invalidated. validation happen even query implied ... include packets complete tree required. validation also interact core.use_file_store repair supported, becomes trivial.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":null,"dir":"Reference","previous_headings":"","what":"Query index — query_index","title":"Query index — query_index","text":"Class managing active index whilst evaluating query","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"Query index — query_index","text":"index packet index depends Named list data frames. Names packet ids, values packets depended packet id (.e. parents). uses Named list data frames. Names packet ids, values packets used packet id (.e. children). root outpack root object","code":""},{"path":[]},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Query index — query_index","text":"query_index$new() query_index$get_packet_depends() query_index$get_packet_uses()","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Query index — query_index","text":"Create new query_index object","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Query index — query_index","text":"","code":"query_index$new(root, index, depends, uses)"},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query index — query_index","text":"root outpack root object index packet index data frame depends Named list data frames. Names packet ids, values packets depended packet id (.e. parents). uses Named list data frames. Names packet ids, values packets used packet id (.e. children). data depends relationships flow direction.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"method-get-packet-depends-","dir":"Reference","previous_headings":"","what":"Method get_packet_depends()","title":"Query index — query_index","text":"Get ids packets packet depends specified level","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Query index — query_index","text":"","code":"query_index$get_packet_depends(id, depth)"},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query index — query_index","text":"id id packet get parents depth Depth parents get, depth 1 gets immediate parents depth 2 gets parents parents parents, depth Inf recurse whole tree get parents","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Query index — query_index","text":"ids parents packet","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"method-get-packet-uses-","dir":"Reference","previous_headings":"","what":"Method get_packet_uses()","title":"Query index — query_index","text":"Get ids packets used packet","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Query index — query_index","text":"","code":"query_index$get_packet_uses(id, depth)"},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query index — query_index","text":"id id packet get children depth Depth children get, depth 1 gets immediate children depth 2 gets children children children, depth Inf recurse whole tree get children","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"Query index — query_index","text":"ids children packet","code":""}]
+[{"path":"https://mrc-ide.github.io/orderly2/articles/collaboration.html","id":"type-of-location","dir":"Articles","previous_headings":"","what":"Type of location","title":"Collaborative analysis","text":"orderly2 supports two types locations default: path: orderly2 working copy can find filesystem. Note copy people can see (example network share, cloud-synced file system Dropbox OneDrive) http: require running HTTP API, either via outpack_server packit location system somewhat extensible, details subject change. outpack.sharepoint using SharePoint, may write backends later. documentation behave regardless location stored mechanism transport, can focus instead workflows.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/collaboration.html","id":"an-example","dir":"Articles","previous_headings":"","what":"An example","title":"Collaborative analysis","text":"Suppose two researchers, Alice Bob, collaborating piece analysis. purposes example (find common situation practice) share source tree analysis git. Alice Bob clone repo onto machines, using favourite git client (terminal git, via GitHub desktop, gert) moment, including hidden files (except .git), Alice sees: point, cloning Alice .outpack directory (see ) Alice needs run orderly::orderly_init() first: plan work Bob, sharing results shared server, Alice adds orderly2 configuration orderly2::orderly_location_add(): done, can run analysis: Perhaps takes several goes Alice happy analysis, point something ready share. can “push” final packet onto server: Now, consider Bob. also needs source code cloned, orderly initialised, server added: (, Bob also used name server refer shared server, used anything; similar git’s use origin.) Bob can now query packets available server: seen new “data” packet , can pull locally (TODO: mrc-4414 makes nicer): Now Bob position develop packet Alice ran (20231120-112036-0a247508)","code":"fs::dir_tree(\".\", all = TRUE, glob = \".git\", invert = TRUE) ## . ## ├── orderly_config.yml ## └── src ## └── data ## └── orderly.R orderly2::orderly_list_src() ## [1] \"data\" orderly2::orderly_init(\".\") ## ✔ Created orderly root at '/tmp/RtmpX52QIf/file1d174adb72cf/alice' ## ✔ Wrote '.gitignore' orderly2::orderly_list_src() ## [1] \"data\" orderly2::orderly_location_add( \"server\", \"http\", list(url = \"http://orderly.example.com\")) id <- orderly2::orderly_run(\"data\") ## ℹ Starting packet 'data' `20231120-112036-0a247508` at 2023-11-20 11:20:36.046075 ## > orderly2::orderly_artefact(\"Final data\", \"data.rds\") ## > saveRDS(mtcars, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231120-112036-0a247508 at 2023-11-20 11:20:36.105516 (0.05944109 secs) orderly2::orderly_location_push(id, \"server\") orderly2::orderly_init(\".\") ## ✔ Created orderly root at '/tmp/RtmpX52QIf/file1d174adb72cf/bob' ## ✔ Wrote '.gitignore' orderly2::orderly_location_add( \"server\", \"http\", list(url = \"http://orderly.example.com\")) orderly2::orderly_metadata_extract( name = \"data\", options = list(allow_remote = TRUE, pull_metadata = TRUE)) ## id name parameters ## 1 20231120-112036-0a247508 data 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 [4ms] ## ✔ Fetched 2 files (1.3 kB) from 'server' in 26ms. ##"},{"path":"https://mrc-ide.github.io/orderly2/articles/collaboration.html","id":"possible-working-patterns","dir":"Articles","previous_headings":"","what":"Possible working patterns","title":"Collaborative analysis","text":"seen several broad patterns distributing packets. Central server, push allowed: case ; flexible requires everyone relaxed packets created ultimately trusting colleagues exercising good environment hygiene. Just rules enforced computer though, doesn’t mean might ideas within group can push. may useful push HPC system running computationally demanding tasks . Central server, final copy run : case, Alice Bob can run things server, “canonical” copies, nothing pushed server. Reports can run server ssh-ing onto server running packets manually (TODO: mrc-4412) using web interface (possible OrderlyWeb possible packit). approach works well primary goal confidence packets everyone works dependencies created “clean” environment unexpected global dependencies. web version, can also enforce things like running default branch. Alice Bob end collection packets local archives mix canonical ones (server) locally-created ones, local ones always dead end never get shared anyone. result, Alice Bob may delete archive directories without great concern. running packets, make sure packet run similar way packet run server, Bob may want ensure dependencies found server considered. , can create search options pass orderly2::orderly_run running report. developing, Bob may find passing orderly2::orderly_interactive_set_search_options() helpful mean calls orderly2::orderly_description() use packets server. Staging production servers: might set multiple servers, one staging, one production. staging servers never source truth might (might ) allow people push , less strict rules gets run (perhaps allowing running packets feature branch). setting, users end packets created locally, staging machines production server local archive. staging server probably end mix packets packets production. approach specifying search options useful choosing included final packet.","code":"search_options <- orderly2::orderly_search_options(location = \"server\")"},{"path":"https://mrc-ide.github.io/orderly2/articles/collaboration.html","id":"pulling-complete-trees-or-not","dir":"Articles","previous_headings":"","what":"Pulling complete trees, or not","title":"Collaborative analysis","text":"pull packets server (orderly2::orderly_location_pull_packet()), depending settings either end just packet request, packet plus recursive dependencies. controlled configuration option core.require_complete_tree, FALSE default; suitable users, servers set core.require_complete_tree = TRUE. situations , users never holding canonical source packets - matter don’t dependencies. hold metadata packets (, recursively) download dependencies later wanted inspect . Typically though, just extra space used disk. push packet server, always pushes complete tree.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/collaboration.html","id":"moving-as-little-data-as-possible","dir":"Articles","previous_headings":"","what":"Moving as little data as possible","title":"Collaborative analysis","text":"pulling packets, first user pulls metadata server. orderly2::orderly_location_metadata_pull run, metadata server updated client (mrc-4444 make lazier). now know everything server holds, hashes files contained packet. likely already know files within packet requested, client first looks see exist within archive, verifying changed. requests server files resolve locally. recursive pull (core.require_complete_tree = TRUE) look union files set packets currently missing archive. frequently much less full set files within packets. algorithm similar push: look full dependency chain target packet find file ids ask server yet know unknown subset get union file hashes ask server subset files yet know push files - done one time present done simultaneously async requests future files sever upload missing metadata, chronological order server verifies packet metadata dependencies referenced files multi-step process means avoid copying data already known , well avoiding moving data multiple times. also means process pushing (pulling) interrupted can safely resumed state always consistent.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/collaboration.html","id":"interaction-between-source-tree-and--outpack","dir":"Articles","previous_headings":"","what":"Interaction between source tree and .outpack","title":"Collaborative analysis","text":"important .outpack directory shared via git; warn now, can use orderly2::ordery_gitignore_update() automatically create suitable .gitignore file prevent accidentally committed. However, Alice Bob starting new machine : clone source repository run orderly2::orderly_init() within directory run orderly2 commands normal Without running orderly2::orderly_init(), get error prompting initialise repo. requirement different repositories share configuration options passed orderly2::orderly_init(); can enable disable file store different sets locations enabled, depending workflows. means , practice, association convention set related orderly2 locations source tree can orderly2 repository points locations refer different source trees!","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/dependencies.html","id":"using-dependencies","dir":"Articles","previous_headings":"","what":"Using dependencies","title":"Dependencies between packets","text":", show practically use dependencies common scenarios increasing complexity. code examples purposefully -simple order keep presentation straightforward, see end document discussion complex pieces code might “optimally” .","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/dependencies.html","id":"basic-use","dir":"Articles","previous_headings":"Using dependencies","what":"Basic use","title":"Dependencies between packets","text":"primary mechanism using dependencies call orderly2::orderly_dependency() within orderly.R script; finds suitable completed packet copies files found within packet current report. src/analysis/orderly.R contains: , ’ve used orderly2::orderly_dependency() pull file data.rds recent version (latest()) data packet, ’ve used file normal make plot, ’ve saved analysis.png (similar example vignette(\"introduction\"), get us started). look metadata packet created analysis report, can see used 20231120-112038-eb33b984 dependency: (indeed , one copy data packet pick ).","code":"## src ## ├── analysis ## │ └── orderly.R ## └── data ## ├── data.csv ## └── orderly.R orderly2::orderly_dependency(\"data\", \"latest()\", \"data.rds\") d <- readRDS(\"data.rds\") png(\"analysis.png\") plot(y ~ x, d) dev.off() id1 <- orderly2::orderly_run(\"data\", root = path) ## ℹ Starting packet 'data' `20231120-112038-eb33b984` at 2023-11-20 11:20:38.921905 ## > d <- read.csv(\"data.csv\") ## > d$z <- resid(lm(y ~ x, d)) ## > saveRDS(d, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231120-112038-eb33b984 at 2023-11-20 11:20:38.959614 (0.03770947 secs) id2 <- orderly2::orderly_run(\"analysis\", root = path) ## ℹ Starting packet 'analysis' `20231120-112038-fa65776e` at 2023-11-20 11:20:38.98112 ## > orderly2::orderly_dependency(\"data\", \"latest()\", \"data.rds\") ## ℹ Depending on data @ `20231120-112038-eb33b984` (via latest(name == \"data\")) ## > d <- readRDS(\"data.rds\") ## > png(\"analysis.png\") ## > plot(y ~ x, d) ## > dev.off() ## agg_png ## 2 ## ✔ Finished running orderly.R ## ℹ Finished 20231120-112038-fa65776e at 2023-11-20 11:20:39.053611 (0.07249165 secs) orderly2::orderly_metadata(id2, root = path)$depends ## packet query files ## 1 20231120-112038-eb33b984 latest(name == \"data\") data.rds...."},{"path":"https://mrc-ide.github.io/orderly2/articles/dependencies.html","id":"filtering-candidates-by-parameters","dir":"Articles","previous_headings":"Using dependencies","what":"Filtering candidates by parameters","title":"Dependencies between packets","text":"example, query simple — recently created packet name data. One common pattern see analysis might parameter (example country name) downstream analysis might share parameter want pull data country. src/data/orderly.R containing: can run several values cyl: follow-analysis contains: query latest(parameter:cyl == :cyl) says “find recent packet ’s parameter”cyl” (parameter:cyl) parameter currently running report (:cyl).","code":"## src ## ├── analysis ## │ └── orderly.R ## └── data ## └── orderly.R orderly2::orderly_parameters(cyl = NULL) d <- mtcars[mtcars$cyl == cyl, ] saveRDS(d, \"data.rds\") orderly2::orderly_run(\"data\", list(cyl = 4), root = path) ## ℹ Starting packet 'data' `20231120-112039-6ba2c26e` at 2023-11-20 11:20:39.423598 ## ℹ Parameters: ## • cyl: 4 ## > orderly2::orderly_parameters(cyl = NULL) ## > d <- mtcars[mtcars$cyl == cyl, ] ## > saveRDS(d, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231120-112039-6ba2c26e at 2023-11-20 11:20:39.456121 (0.03252292 secs) ## [1] \"20231120-112039-6ba2c26e\" orderly2::orderly_run(\"data\", list(cyl = 6), root = path) ## ℹ Starting packet 'data' `20231120-112039-7909921f` at 2023-11-20 11:20:39.47583 ## ℹ Parameters: ## • cyl: 6 ## > orderly2::orderly_parameters(cyl = NULL) ## > d <- mtcars[mtcars$cyl == cyl, ] ## > saveRDS(d, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231120-112039-7909921f at 2023-11-20 11:20:39.509818 (0.03398752 secs) ## [1] \"20231120-112039-7909921f\" orderly2::orderly_run(\"data\", list(cyl = 8), root = path) ## ℹ Starting packet 'data' `20231120-112039-870a2b4c` at 2023-11-20 11:20:39.530481 ## ℹ Parameters: ## • cyl: 8 ## > orderly2::orderly_parameters(cyl = NULL) ## > d <- mtcars[mtcars$cyl == cyl, ] ## > saveRDS(d, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231120-112039-870a2b4c at 2023-11-20 11:20:39.558818 (0.02833676 secs) ## [1] \"20231120-112039-870a2b4c\" orderly2::orderly_parameters(cyl = NULL) orderly2::orderly_dependency( \"data\", \"latest(parameter:cyl == this:cyl)\", \"data.rds\") d <- readRDS(\"data.rds\") png(\"analysis.png\") plot(mpg ~ disp, d) dev.off() orderly2::orderly_run(\"analysis\", list(cyl = 4), root = path) ## ℹ Starting packet 'analysis' `20231120-112039-b403f427` at 2023-11-20 11:20:39.706233 ## ℹ Parameters: ## • cyl: 4 ## > orderly2::orderly_parameters(cyl = NULL) ## > orderly2::orderly_dependency( ## + \"data\", ## + \"latest(parameter:cyl == this:cyl)\", ## + \"data.rds\") ## ℹ Depending on data @ `20231120-112039-6ba2c26e` (via latest(parameter:cyl == this:cyl && name == \"data\")) ## > d <- readRDS(\"data.rds\") ## > png(\"analysis.png\") ## > plot(mpg ~ disp, d) ## > dev.off() ## agg_png ## 2 ## ✔ Finished running orderly.R ## ℹ Finished 20231120-112039-b403f427 at 2023-11-20 11:20:39.756862 (0.05062938 secs) ## [1] \"20231120-112039-b403f427\""},{"path":"https://mrc-ide.github.io/orderly2/articles/dependencies.html","id":"interpreting-errors","dir":"Articles","previous_headings":"Using dependencies","what":"Interpreting errors","title":"Dependencies between packets","text":"query fails resolve candidate error: error message tries fairly self explanatory; failed find packet satisfies querylatest(parameter:cyl == :cyl && name == \"data\"); note report name data become part query, two conditions matched . error suggests running rlang::last_error()$explanation information, can : orderly_query_explain object, tries come reasons query might matched; ’ll expand future let us know might like see. tells query can decomposed two subqueries (match parameter cyl 9000), matched packets B (match packet name data), matched 3 packets. subquery matched packets pairs don’t try guide towards problematic pairs. can also ask orderly2 explain query : save object can explore detail: (worked rlang::last_error()$explanation$parts$). can also use orderly2::orderly_metadata_extract work values might looked :","code":"orderly2::orderly_run(\"analysis\", list(cyl = 9000), root = path) ## ℹ Starting packet 'analysis' `20231120-112039-d6d9117b` at 2023-11-20 11:20:39.842264 ## ℹ Parameters: ## • cyl: 9000 ## > orderly2::orderly_parameters(cyl = NULL) ## > orderly2::orderly_dependency( ## + \"data\", ## + \"latest(parameter:cyl == this:cyl)\", ## + \"data.rds\") ## ✖ Error running orderly.R ## ℹ Finished 20231120-112039-d6d9117b at 2023-11-20 11:20:39.904574 (0.06231046 secs) ## Error in `orderly2::orderly_run()`: ## ! Failed to run report ## Caused by error in `outpack_packet_use_dependency()`: ## ! Failed to find packet for query 'latest(parameter:cyl == this:cyl && ## name == \"data\")' ## ℹ See 'rlang::last_error()$explanation' for details rlang::last_error()$explanation ## Evaluated query: 'latest(A && B)' and found 0 packets ## • A (parameter:cyl == this:cyl): 0 packets ## ## • B (name == \"data\"): 3 packets orderly2::orderly_query_explain( quote(latest(parameter:cyl == 9000)), name = \"data\", root = path) ## Evaluated query: 'latest(A && B)' and found 0 packets ## • A (parameter:cyl == 9000): 0 packets ## ## • B (name == \"data\"): 3 packets explanation <- orderly2::orderly_query_explain( quote(latest(parameter:cyl == 9000)), name = \"data\", root = path) explanation$parts$B ## $name ## [1] \"B\" ## ## $str ## [1] \"name == \\\"data\\\"\" ## ## $expr ## name == \"data\" ## ## $n ## [1] 3 ## ## $found ## [1] \"20231120-112039-6ba2c26e\" \"20231120-112039-7909921f\" ## [3] \"20231120-112039-870a2b4c\" orderly2::orderly_metadata_extract( name = \"data\", extract = c(cyl = \"parameters.cyl is number\"), root = path) ## id cyl ## 1 20231120-112039-6ba2c26e 4 ## 2 20231120-112039-7909921f 6 ## 3 20231120-112039-870a2b4c 8"},{"path":"https://mrc-ide.github.io/orderly2/articles/dependencies.html","id":"filtering-candidates-in-other-ways","dir":"Articles","previous_headings":"Using dependencies","what":"Filtering candidates in other ways","title":"Dependencies between packets","text":"saw two types filtering candidates: latest() selected recent packet latest(parameter:cyl == :cyl) found packet whose parameter matched one parameters. used latest(parameter:cyl == 4) hard code specific parameter value, used latest(parameter:cyl == environment:cyl) match whatever value cyl took evaluating environment. Instead query, can provide single id (e.g, 20231120-112039-b403f427), mean even new copies data packet created, dependency always resolve value. can chain together logical operations && (sides must true) || (either side must true), group conditions parentheses. addition ==, usual complement comparison operators work. might complex queries like practice people queries series restrictions &&.","code":"latest((parameter:x == 1 || parameter:x == 2) && parameter:y > 10)"},{"path":"https://mrc-ide.github.io/orderly2/articles/dependencies.html","id":"computing-dependencies-and-using-many-dependencies-at-once","dir":"Articles","previous_headings":"Using dependencies","what":"Computing dependencies and using many dependencies at once","title":"Dependencies between packets","text":"One common pattern map-reduce pattern set orderly reports. , set packets created vector parameters, perhaps chain different reports parameter, combined together. parameter p takes values “x”, “y” “z”, might look like: , D want combine three copies C packet, one p “x”, “y” “z”. Especially three values hard coded, might just write Note call vary second argument select different parameter value, third argument naming destination file different name (end three files data/). can write loop: , second argument use environment:p fetch value p calling environment - looping value take three values. name third argument, use special interpolation format ${p} substitute value p build filename.","code":"B(p = \"x\") -- C(p = \"x\") / \\ A - B(p = \"y\") -- C(p = \"y\") - D \\ / B(p = \"z\") -- C(p = \"z\") orderly2::orderly_dependency(\"C\", quote(latest(parameter:p == \"x\")), c(\"data/x.rds\" = \"result.rds\")) orderly2::orderly_dependency(\"C\", quote(latest(parameter:p == \"y\")), c(\"data/y.rds\" = \"result.rds\")) orderly2::orderly_dependency(\"C\", quote(latest(parameter:p == \"z\")), c(\"data/z.rds\" = \"result.rds\")) for (p in c(\"x\", \"y\", \"z\")) { orderly2::orderly_dependency(\"C\", quote(latest(parameter:p == environment:p)), c(\"data/${p}.rds\" = \"result.rds\")) }"},{"path":"https://mrc-ide.github.io/orderly2/articles/dependencies.html","id":"how-dependencies-interact-with-locations","dir":"Articles","previous_headings":"","what":"How dependencies interact with locations","title":"Dependencies between packets","text":"default, packet unpacked local archive considered candidate inclusion orderly_dependency(). always want. locations selected, packets within considered candidates can controlled search_options argument orderly2::orderly_run (note argument orderly_run(), orderly_dependency() effect controlled runner report, writer report). three components affect packets selected location: character vector locations, matching location names. packets can found locations considered. mix locally created packets well ones people can see, specifying location = \"server\" limit packets available server, means end dependencies colleagues also get. allow_remote: controls willing download files location order satisfy dependency. TRUE, run report, might download files recent packets available location locally. pull_metadata: effect allow_remote also TRUE; causes metadata refreshed dependency resolution. discussion details ?orderly_run","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/dependencies.html","id":"other-points","dir":"Articles","previous_headings":"","what":"Other points","title":"Dependencies between packets","text":"used systems like targets, easy make reports smaller need . ’s real need make small, picking right size challenge. small, ’ll end writing lot code orchestrate running different reports pulling things together. ’ll end spending lot time whether things “date” one another really group things always wants run together. ’re big might end work want , order make change part piece analysis must run whole thing .","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"creating-an-empty-orderly-repository","dir":"Articles","previous_headings":"","what":"Creating an empty orderly repository","title":"Introduction to orderly2","text":"first step initialise empty orderly2 repository. orderly2 repository directory file orderly_config.yml within , since version 2 also directory .outpack/. Files within .outpack/ directory never directly modified users directory excluded version control (see orderly2::orderly_gitignore_update). Create orderly2 repository calling orderly2::orderly_init(): creates files: step performed completely empty directory, otherwise error thrown. Later, re-initialise orderly2 repository cloning new machine, working others; discussed vignette(\"collaboration\")l. orderly_config.yml file contains little default:","code":"path <- tempfile() # we'll use a temporary directory here orderly2::orderly_init(path) ## ✔ Created orderly root at '/tmp/RtmpwiXhcT/file1da25bb2030f' ## . ## ├── .outpack ## │ ├── config.json ## │ ├── location ## │ └── metadata ## └── orderly_config.yml minimum_orderly_version: \"1.99.0\""},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"creating-your-first-orderly-report","dir":"Articles","previous_headings":"","what":"Creating your first orderly report","title":"Introduction to orderly2","text":"orderly report directory src/ containing file orderly.R. file may special commands , now ’ll create one simple possible; ’ll create random data save disk. seems silly, imagine standing something like: downloading file external site resource running simulation saving output fitting model data merging set files together create final data set directory structure (ignoring .outpack) looks like: src/incoming_data/orderly.R contains: run report create new packet, use orderly2::orderly_run(): id created new identifier packet unique among packets (within reason) chronologically sortable. packet id sorts another packet’s id started packet. run report, directory structure looks like: things changed : file created ran report (data.rds; see script ) log happened report run packet created orderly.R data.csv, original input come source tree empty directory draft/incoming_data created orderly ran report first place addition, quite files changed within .outpack directory, covered . ’s ! Notice initial script just plain R script, can develop interactively within src/incoming_data directory. Note however, paths referred within relative src/incoming_data orderly repository root. important reports see world relative orderly.R file. created, can refer report id pull files wherever need , context another orderly report just copy desktop email someone. example, copy file data.rds created location outside orderly’s control copies data.rds new temporary directory dest name final.rds. uses orderly2’s outpack_ functions, designed interact outpack archives regardless created (orderly2 program creates outpack archives). Typically lower-level orderly_ functions.","code":"## . ## ├── orderly_config.yml ## └── src ## └── incoming_data ## ├── data.csv ## └── orderly.R d <- read.csv(\"data.csv\") d$z <- resid(lm(y ~ x, d)) saveRDS(d, \"data.rds\") id <- orderly2::orderly_run(\"incoming_data\", root = path) ## ℹ Starting packet 'incoming_data' `20231120-112042-f7b8a143` at 2023-11-20 11:20:42.972603 ## > d <- read.csv(\"data.csv\") ## > d$z <- resid(lm(y ~ x, d)) ## > saveRDS(d, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231120-112042-f7b8a143 at 2023-11-20 11:20:43.035946 (0.06334329 secs) id ## [1] \"20231120-112042-f7b8a143\" ## . ## ├── archive ## │ └── incoming_data ## │ └── 20231120-112042-f7b8a143 ## │ ├── data.csv ## │ ├── data.rds ## │ └── orderly.R ## ├── draft ## │ └── incoming_data ## ├── orderly_config.yml ## └── src ## └── incoming_data ## ├── data.csv ## └── orderly.R dest <- tempfile() fs::dir_create(dest) orderly2::orderly_copy_files(id, files = c(\"final.rds\" = \"data.rds\"), dest = dest, root = path)"},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"depending-on-packets-from-another-report","dir":"Articles","previous_headings":"","what":"Depending on packets from another report","title":"Introduction to orderly2","text":"Creating new dataset mostly useful someone else can use . introduce first special orderly commands can use orderly.R src/ directory now looks like: src/analysis/orderly.R contains: , ’ve used orderly2::orderly_dependency() pull file data.rds recent version (latest()) data packet filename incoming.rds, ’ve used file normal make plot, ’ve saved analysis.png. can run just , using orderly2::orderly_run(): information dependencies, see vignette(\"dependencies\").","code":"## src ## ├── analysis ## │ └── orderly.R ## └── incoming_data ## ├── data.csv ## └── orderly.R orderly2::orderly_dependency(\"incoming_data\", \"latest()\", c(\"incoming.rds\" = \"data.rds\")) d <- readRDS(\"incoming.rds\") png(\"analysis.png\") plot(y ~ x, d) dev.off() id <- orderly2::orderly_run(\"analysis\", root = path) ## ℹ Starting packet 'analysis' `20231120-112043-776b49db` at 2023-11-20 11:20:43.469597 ## > orderly2::orderly_dependency(\"incoming_data\", \"latest()\", ## + c(\"incoming.rds\" = \"data.rds\")) ## ℹ Depending on incoming_data @ `20231120-112042-f7b8a143` (via latest(name == \"incoming_data\")) ## > d <- readRDS(\"incoming.rds\") ## > png(\"analysis.png\") ## > plot(y ~ x, d) ## > dev.off() ## agg_png ## 2 ## ✔ Finished running orderly.R ## ℹ Finished 20231120-112043-776b49db at 2023-11-20 11:20:43.553267 (0.08367038 secs)"},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"available-in-report-orderly-commands","dir":"Articles","previous_headings":"","what":"Available in-report orderly commands","title":"Introduction to orderly2","text":"function orderly2::orderly_dependency() designed operate packet runs. functions act adding metadata final packet, perhaps copying files directory. orderly2::orderly_description(): Provide longer name description report; can reflected tooling uses orderly metadata much informative short name. orderly2::orderly_parameters(): Declares parameters can passed control behaviour report. Parameters key-value pairs simple data (booleans, numbers, strings) report can respond . can also used queries orderly2::orderly_dependency() find packets satisfy criteria. orderly2::orderly_resource(): Declares file resource; file input report, comes source directory. default, orderly treats files directory resource, can useful mark explicitly, necessary “strict mode” (see ). Files marked resource immutable may deleted modified. orderly2::orderly_shared_resource(): Copies file “shared resources” directory shared/, can data files source code located root orderly repository. can reasonable way sharing data commonly used code among several reports. orderly2::orderly_artefact(): Declares file (set files) created report, even run. makes easier check report behaves expected can allow reasoning related set reports without running . declaring something artefact (especially conjunction “strict mode”) also easier clean src directories used interactive development (see ). orderly2::orderly_dependency(): Copy files one packet packet runs, seen . orderly2::orderly_strict_mode(): Declares report run “strict mode” (see ). addition, also function orderly::orderly_run_info() can used running report returns information currently running report (id, resolved dependencies etc). Let’s add additional annotations previous reports: , ’ve added block special orderly commands; go anywhere, example files refer . strict mode enabled (see ) orderly2::orderly_resource calls must go files used made available point (see ).","code":"orderly2::orderly_strict_mode() orderly2::orderly_resource(\"data.csv\") orderly2::orderly_artefact(\"Processed data\", \"data.rds\") d <- read.csv(\"data.csv\") d$z <- resid(lm(y ~ x, d)) saveRDS(d, \"data.rds\") id <- orderly2::orderly_run(\"incoming_data\", root = path) ## ℹ Starting packet 'incoming_data' `20231120-112043-c22cd10a` at 2023-11-20 11:20:43.760423 ## > orderly2::orderly_strict_mode() ## > orderly2::orderly_resource(\"data.csv\") ## > orderly2::orderly_artefact(\"Processed data\", \"data.rds\") ## > d <- read.csv(\"data.csv\") ## > d$z <- resid(lm(y ~ x, d)) ## > saveRDS(d, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231120-112043-c22cd10a at 2023-11-20 11:20:43.790771 (0.03034806 secs)"},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"parameterised-reports","dir":"Articles","previous_headings":"","what":"Parameterised reports","title":"Introduction to orderly2","text":"Much flexibility comes orderly graph comes using parameterised reports; reports take set parameters change behaviour based parameters. Downstream reports can depend parameterised report filter based suitable parameters. example, consider simple report generate samples based parameter: creates report single parameter n_samples default value 10. used define parameter default, defined multiple parameters can anything report switches value parameter: might read different URLs fetch different underlying data might fit different analysis might read different shared resources (see ) might depend different dependencies might produce different artefacts However, see parameters relatively heavyweight things try consistent set packets created report. report use control size generated data set. resulting file 15 rows, parameter passed affected report: can use parameters orderly’s search functions. example can find recent version packet running: can also pass parameter queries : can used within orderly2::orderly_dependency() (name == \"random\" part implied first name argument), example case report querying also parameters can use within query, using prefix. suppose downstream report simply uses n number samples might write: depend recent packet called random parameter n_samples value current report’s parameter n. See outpack query documentation much detail .","code":"orderly2::orderly_parameters(n_samples = 10) x <- seq_len(n_samples) d <- data.frame(x = x, y = x + rnorm(n_samples)) saveRDS(d, \"data.rds\") orderly2::orderly_parameters(n_samples = NULL) orderly2::orderly_parameters(n_samples = 10, distribution = \"normal\") id <- orderly2::orderly_run(\"random\", list(n_samples = 15), root = path) ## ℹ Starting packet 'random' `20231120-112044-01290c33` at 2023-11-20 11:20:44.007604 ## ℹ Parameters: ## • n_samples: 15 ## > orderly2::orderly_parameters(n_samples = 10) ## > x <- seq_len(n_samples) ## > d <- data.frame(x = x, y = x + rnorm(n_samples)) ## > saveRDS(d, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231120-112044-01290c33 at 2023-11-20 11:20:44.039924 (0.03231955 secs) orderly2::orderly_copy_files(id, files = c(\"random.rds\" = \"data.rds\"), dest = dest, root = path) readRDS(file.path(dest, \"random.rds\")) ## x y ## 1 1 0.08554663 ## 2 2 2.23776056 ## 3 3 3.23559622 ## 4 4 4.85353465 ## 5 5 5.15146501 ## 6 6 6.51695446 ## 7 7 6.17385884 ## 8 8 7.51134552 ## 9 9 9.02122446 ## 10 10 10.52457516 ## 11 11 10.44623540 ## 12 12 13.24811337 ## 13 13 12.42173019 ## 14 14 13.98601361 ## 15 15 16.55113467 orderly2::orderly_search('latest(name == \"random\")', root = path) ## [1] \"20231120-112044-01290c33\" orderly2::orderly_search('latest(name == \"random\" && parameter:n_samples > 10)', root = path) ## [1] \"20231120-112044-01290c33\" orderly2::orderly_dependency(\"random\", \"latest(parameter:n_samples > 10)\", c(\"randm.rds\" = \"data.rds\")) orderly2::orderly_dependency(\"random\", \"latest(parameter:n_samples == this:n)\", c(\"randm.rds\" = \"data.rds\"))"},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"shared-resources","dir":"Articles","previous_headings":"","what":"Shared resources","title":"Introduction to orderly2","text":"Sometimes useful share data different reports, example common source utilities don’t warrant package, common data. , create directory shared orderly root put files directories might want share. Suppose shared directory contains file data.csv: can write orderly report use_shared uses shared file, orderly.R containing: can run : resulting archive, file used shared directory present: general property orderly: tries save inputs alongside final results analysis, later can check see went analysis might changed versions.","code":"## . ## ├── archive ## │ ├── analysis ## │ │ └── 20231120-112043-776b49db ## │ │ ├── analysis.png ## │ │ ├── incoming.rds ## │ │ └── orderly.R ## │ ├── incoming_data ## │ │ ├── 20231120-112042-f7b8a143 ## │ │ │ ├── data.csv ## │ │ │ ├── data.rds ## │ │ │ └── orderly.R ## │ │ └── 20231120-112043-c22cd10a ## │ │ ├── data.csv ## │ │ ├── data.rds ## │ │ └── orderly.R ## │ └── random ## │ └── 20231120-112044-01290c33 ## │ ├── data.rds ## │ └── orderly.R ## ├── draft ## │ ├── analysis ## │ ├── incoming_data ## │ └── random ## ├── orderly_config.yml ## ├── shared ## │ └── data.csv ## └── src ## ├── analysis ## │ └── orderly.R ## ├── incoming_data ## │ ├── data.csv ## │ └── orderly.R ## └── random ## └── orderly.R orderly2::orderly_shared_resource(data.csv = \"data.csv\") orderly2::orderly_artefact(\"analysis\", \"analysis.png\") d <- read.csv(\"data.csv\") png(\"analysis.png\") plot(y ~ x, d) dev.off() id <- orderly2::orderly_run(\"use_shared\", root = path) ## ℹ Starting packet 'use_shared' `20231120-112044-7e33abff` at 2023-11-20 11:20:44.496305 ## > orderly2::orderly_shared_resource(data.csv = \"data.csv\") ## > orderly2::orderly_artefact(\"analysis\", \"analysis.png\") ## > d <- read.csv(\"data.csv\") ## > png(\"analysis.png\") ## > plot(y ~ x, d) ## > dev.off() ## agg_png ## 2 ## ✔ Finished running orderly.R ## ℹ Finished 20231120-112044-7e33abff at 2023-11-20 11:20:44.533126 (0.03682137 secs) ## archive/use_shared ## └── 20231120-112044-7e33abff ## ├── analysis.png ## ├── data.csv ## └── orderly.R"},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"strict-mode","dir":"Articles","previous_headings":"","what":"Strict mode","title":"Introduction to orderly2","text":"previous version orderly (orderly1; see vignette(\"migrating\")) fussy input strictly declared report run, clear really required order run something. version 2 relaxed default, can opt old behaviours checks adding anywhere within orderly.R script (conventionally top). may make granular future, adding : copy files source directory (src//) draft directory report runs (draft//) declared orderly2::orderly_resource; leaves behind extra files left development warn end running packet files found part artefact Using strict mode also helps orderly2 clean src/ directory effectively interactive development (see next section).","code":"orderly2::orderly_strict_mode()"},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"interactive-development","dir":"Articles","previous_headings":"","what":"Interactive development","title":"Introduction to orderly2","text":"Set working directory src/ orderly script fully executable (e.g., source Rstudio’s Source button, R’s source() function). Dependencies copied needed. , mix files within source directory. recommend per-source-directory .gitignore keep files version control (see ). soon implement support cleaning generated files directory. example, suppose interactively run incoming_data/orderly.R script, leave behind generated files. can report orderly2::orderly_cleanup_status: files unknown orderly tell prompt tell explicitly. can clean generated files running (suggested message): dry_run = TRUE argument can pass want see deleted without using status function. can also keep files git using orderly2::orderly_gitignore_update function: creates (updates) .gitignore file within report generated files included git. already accidentally committed gitignore real effect git surgery, see git manuals handy, profane, guide.","code":"orderly2::orderly_cleanup_status(\"incoming_data\", root = path) ## ✖ incoming_data is not clean: ## ℹ 1 file can be deleted by running 'orderly2::orderly_cleanup(\"incoming_data\")': ## • data.rds orderly2::orderly_cleanup(\"incoming_data\", root = path) ## ℹ Deleting 1 file from 'incoming_data': ## • data.rds orderly2::orderly_gitignore_update(\"incoming_data\", root = path) ## ✔ Wrote 'src/incoming_data/.gitignore'"},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"deleting-things-from-the-archive","dir":"Articles","previous_headings":"","what":"Deleting things from the archive","title":"Introduction to orderly2","text":"delete packets archive/ directory puts orderly2 inconsistent state metadata store. Sometimes matter (e.g., delete old copies never candidates inclusion orderly2::orderly_dependency never notice). However, delete recent copy packet try depend , get error. moment, two copies incoming_data task: run analysis task, pull recent version (20231120-112043-c22cd10a). However, deleted manually (e.g., save space accidentally) corrupted (e.g., opening output Excel letting save changes) able included, running analysis fail: error tries fairly informative, telling us failed copying files 20231120-112043-c22cd10a found packet corrupt, file data.rds found archive. also suggests fix; can tell orderly2 20231120-112043-c22cd10a “orphaned” considered inclusion look dependencies. can carry suggestion just validate packet running can validate packets : option core.require_complete_tree enabled, process also look packets used now-deleted packet orphan , longer complete tree includes . want remove references orphaned packets, can use orderly2::orderly_prune_orphans() remove entirely:","code":"orderly2::orderly_metadata_extract( name = \"incoming_data\", extract = c(time = \"time.start\"), root = path) ## id time ## 1 20231120-112042-f7b8a143 2023-11-20 11:20:42 ## 2 20231120-112043-c22cd10a 2023-11-20 11:20:43 orderly2::orderly_run(\"analysis\", root = path) ## ℹ Starting packet 'analysis' `20231120-112045-1b333941` at 2023-11-20 11:20:45.109312 ## > orderly2::orderly_dependency(\"incoming_data\", \"latest()\", ## + c(\"incoming.rds\" = \"data.rds\")) ## ✖ Error running orderly.R ## ℹ Finished 20231120-112045-1b333941 at 2023-11-20 11:20:45.213773 (0.1044617 secs) ## Error in `orderly2::orderly_run()`: ## ! Failed to run report ## Caused by error in `orderly_copy_files()`: ## ! Unable to copy files, due to deleted packet 20231120-112043-c22cd10a ## ℹ Consider 'orderly2::orderly_validate_archive(\"20231120-112043-c22cd10a\", ## action = \"orphan\")' to remove this packet from consideration ## Caused by error: ## ! File not found in archive ## ✖ data.rds orderly2::orderly_validate_archive(\"20231120-112043-c22cd10a\", action = \"orphan\") orderly2::orderly_validate_archive(action = \"orphan\", root = path) ## ✔ 20231120-112042-f7b8a143 (incoming_data) is valid ## ✔ 20231120-112043-776b49db (analysis) is valid ## ✖ 20231120-112043-c22cd10a (incoming_data) is invalid due to its files ## ✔ 20231120-112044-01290c33 (random) is valid ## ✔ 20231120-112044-7e33abff (use_shared) is valid orderly2::orderly_prune_orphans(root = path) ## ℹ Pruning 1 orphan packet"},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"debugging-and-coping-with-errors","dir":"Articles","previous_headings":"","what":"Debugging and coping with errors","title":"Introduction to orderly2","text":"(written)","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"interaction-with-version-control","dir":"Articles","previous_headings":"","what":"Interaction with version control","title":"Introduction to orderly2","text":"guidelines: Make sure exclude files git listing .gitignore: .outpack/ - nothing suitable version control archive/ - core.archive_path set non-null value, excluded. default archive draft/ - temporary draft directory orderly_envir.yml - used setting machine-specific configuration absolutely version control files: src/ main source analyses orderly_config.yml - high level configuration suitable sharing shared resource directory (configured orderly_config.yml) probably version controlled source repository end multiple people’s machines, configured differently. configuration option set via orderly2::orderly_config_set designed (potentially) different different users, configuration needs version controlled. also means reports/packets can’t directly refer values set . includes directory used save archive packets (enabled) names locations (equivalent git remotes). may find useful include scripts help users set common locations, like git, different users may use different names remote (e.g., one user may location called data another called data-incoming, depending perspective use location). orderly2 always try save information current state git source repository alongside packet metadata. includes current branch, commit (sha) remote url. try create links final version packet upstream source repository.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"interaction-with-the-outpack-store","dir":"Articles","previous_headings":"","what":"Interaction with the outpack store","title":"Introduction to orderly2","text":"alluded , .outpack directory contains lots information packets run, typically “bounds” normal use. effectively “database” information packets run. Understanding directory structured required using orderly, included avoidance mystery! See outpack documentation (vignette(\"outpack\")) details ideas . work , directory structure looks like: can perhaps inferred filenames, files .outpack/metadata/ metadata packet run. files .outpack/location// holds information packet first known location (location special “local” location). default orderly configuration store final files directory called archive/, alternatively (additionally) can use content- addressable file store. enabled, .outpack directory looks like: files .outpack/files/ never modified deleted. approach storage naturally deduplicates file archive, large file used many places ever stored .","code":"## .outpack ## ├── config.json ## ├── index ## │ └── outpack.rds ## ├── location ## │ ├── local ## │ │ ├── 20231120-112042-f7b8a143 ## │ │ ├── 20231120-112043-776b49db ## │ │ ├── 20231120-112044-01290c33 ## │ │ └── 20231120-112044-7e33abff ## │ └── orphan ## └── metadata ## ├── 20231120-112042-f7b8a143 ## ├── 20231120-112043-776b49db ## ├── 20231120-112044-01290c33 ## └── 20231120-112044-7e33abff ## .outpack ## ├── config.json ## ├── files ## │ └── sha256 ## │ ├── 0a ## │ │ └── a82571c21c4e5f1f435e8bef2328dda5ef47e177d78d63d1c4ec647a5a388a ## │ ├── 1a ## │ │ └── 587990ac6b99a46172df68e1027895bae2171e56523906c1ce2d16b7596267 ## │ ├── 23 ## │ │ └── 0cb6053c3bc82e67fc339c44b495852c77294bd3b0ccb5c4ba78b06b23e438 ## │ ├── 31 ## │ │ └── 767090cc30c1d59766874709fc54e30aa4b403dde34e8967d6df6685e7e587 ## │ ├── 3b ## │ │ └── 5480ada82151358c503f817aec1b0e768ee4aa1b18c88a7eab77c7239fd848 ## │ ├── 4b ## │ │ └── 2b5fcc7cc6e28fb36543b04037f5d72322a1096aaa0d4c14155436f18bd6b0 ## │ ├── 5f ## │ │ └── 96f49230c2791c05706f24cb2335cd0fad5d3625dc6bca124c44a51857f3f8 ## │ ├── 7e ## │ │ └── becc4d494f325fae5923bc19552f249010382ee48155e148d5537413a90441 ## │ ├── a8 ## │ │ └── b74567ca9defc495d83e974a12c253c7e92fa7334a44a227ca330d8a7bc49e ## │ └── d9 ## │ └── 1699ae410cbd811e1f028f8a732e5162b7df854eec08d921141f965851272d ## ├── index ## │ └── outpack.rds ## ├── location ## │ ├── local ## │ │ ├── 20231120-112042-f7b8a143 ## │ │ ├── 20231120-112043-776b49db ## │ │ ├── 20231120-112044-01290c33 ## │ │ └── 20231120-112044-7e33abff ## │ └── orphan ## └── metadata ## ├── 20231120-112042-f7b8a143 ## ├── 20231120-112043-776b49db ## ├── 20231120-112044-01290c33 ## └── 20231120-112044-7e33abff"},{"path":"https://mrc-ide.github.io/orderly2/articles/introduction.html","id":"relationship-between-orderly-and-outpack","dir":"Articles","previous_headings":"","what":"Relationship between orderly and outpack","title":"Introduction to orderly2","text":"orderly2 package built metadata file storage system called outpack; implementing support working metadata archives languages (see outpack_server server implementation Rust outpack-py Python). metadata discussed detail vignette(\"metadata\") document general ideas fully mrc-ide/outpack","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"basic-overview","dir":"Articles","previous_headings":"","what":"Basic overview","title":"Outpack metadata","text":"“packet” conceptually directory, corresponding particular analysis data product, though necessarily stored. internal representation includes: metadata packet - files contains hashes along information done create environment created etc (see ) actual file contents every included file. might stored simple content-addressable file storage system (see ) actual copies directories originally created Every packet referenced uniquely primary key. use key format encodes current date time, well random data avoid collisions. exists dependency graph among packets, one packet depends another. edge graph hard link (one packet another id) also query (e.g., latest packet name) used find packet. means many ways looking thinking dependency graph. packets available locally, outpack repositories, typically (always) machines accessed HTTP API. conceptually similar git “remotes”. need distinguish packets “unpacked” (, packets every file available current archive) packets merely known (metadata files). sometimes refer unpacked packets “local” known “local” location special. use terms “archive” “repository” fairly interchangeably try nail .","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"what-goes-into-a-packet","dir":"Articles","previous_headings":"","what":"What goes into a packet","title":"Outpack metadata","text":"packet must things: name (example model_fits). changed (rather changes tracked) currently way namespacing different repositories id (see “outpack id” ) created outpack point packet started set parameters - mapping strings scalar type (boolean, number, string). Packets may zero many parameters. set files - local (relative) path within packet (e.g., output/data.csv) also hash (e.g., sha256:69f6cf230416cf40828da251a0dad17cbbf078587883e826f3345ff08d1aaa7d) Information packet run (start end time), represented seconds post epoch, UTC (see ). addition may contain information : dependencies used, tracking name included packet, query used find , resolved id, set files extracted packet (source name, hash destination name) names scripts run create packet (typically also included files within final packet) information state git point packet run (current branch, hash, etc) information system used run packet (format unspecified might include hostname, operating system version, package/module versions, etc) custom metadata added implementation","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"types-of-users-of-outpack","dir":"Articles","previous_headings":"","what":"Types of users of outpack","title":"Outpack metadata","text":"types “persona” outpack user imagine exist guide decisions abut layout . extremes : user desktop wants develop run analyses, using files present packets available server. want visually inspect results running packets, need see files disk way makes sense human, care complete copy dependencies graph. server instance responsible delivering packets users (e.g., persona ). expected (able fetch) part outpack graph, expect anyone want visually inspect packets directly machine (, storage need human-readable). impacts two configuration options associated parts directory structure : user use content-addressable “file store” human-readable “archive” (explained detail ) require archive contains complete tree dependencies? expect first persona wants human readable archive contain full tree, second wants opposite.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"directory-layout","dir":"Articles","previous_headings":"","what":"Directory layout","title":"Outpack metadata","text":"section discusses files directory make outpack work, much come ; see . typical .outpack directory layout looks like : (note archive/ .outpack level). directories necessarily present; indeed required file .outpack/config.json.","code":".outpack/ config.json files/ location/ metadata/ archive/"},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"configuration--outpackconfig-json","dir":"Articles","previous_headings":"Directory layout","what":"Configuration (.outpack/config.json)","title":"Outpack metadata","text":"outpack configuration schema defined config.json configuration format still subject change…","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"packet-metadata--outpackmetadata","dir":"Articles","previous_headings":"Directory layout","what":"Packet metadata (.outpack/metadata/)","title":"Outpack metadata","text":"file within directory filename outpack id (matching regular expression ^[0-9]{8}-[0-9]{6}-[0-9a-f]{8}$, see . file json file conforming schema metadata.json. present means outpack implementation can report information back packet (created, files contains, etc), packet metadata meaningful ; want know might come (location distributing packet) copy packet locally.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"location-information--outpacklocation","dir":"Articles","previous_headings":"Directory layout","what":"Location information (.outpack/location/)","title":"Outpack metadata","text":"directory matches regular expression ^[0-9]{8}$ (e.g., 457f4f2a) “location id” (see ) corresponding “location”. file within directory outpack id name, contains json location unpacked (installed) packet, hash metadata. file conforms schema location.json.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"a-file-store--outpackfiles","dir":"Articles","previous_headings":"Directory layout","what":"A file store (.outpack/files)","title":"Outpack metadata","text":"configuration option core.use_file_store true, outpack keeps content addressable file store files knows . much space efficient entire packet unpacked automatically deduplicates shared content among packets (e.g., large file present two packets stored ). file store layout described . storage format human-readable (indeed present within hidden directory .outpack). can enabled either server user","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"an-archive-archive-by-default","dir":"Articles","previous_headings":"Directory layout","what":"An archive (archive/ by default)","title":"Outpack metadata","text":"configuration option core.path_archive non-null directory path containing unpacked packets. packet available path “name” packet, outpack id. several files per packet, possibly directories. storage approach designed human readable, typically enabled outpack repository used laptop user wants interactively work files.","code":"archive///"},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"adding-a-packet","dir":"Articles","previous_headings":"","what":"Adding a packet","title":"Outpack metadata","text":"order make packet available locally, need import metadata files, mark packet available. roughly creating packet (.e., first place packet ever existed) importing packet elsewhere. Making packet available allows used dependency, allows serving packet acting location (http file protocols), guarantees files actually present locally.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"adding-metadata","dir":"Articles","previous_headings":"Adding a packet","what":"Adding metadata","title":"Outpack metadata","text":"can simply copy metadata file .outpack/metadata/ yet exist. make available anything yet known location. Dangling metadata (, metadata present directory known anywhere) currently mostly ignored.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"adding-files","dir":"Articles","previous_headings":"Adding a packet","what":"Adding files","title":"Outpack metadata","text":"repository uses file store, fill first, much easier think . can easily get difference files used packet (list files packet manifest) already file store looking hash turn. request missing files insert store. may leave “dangling” files (files referred packet) problem. repository human-readable archive uses file store, files present file store easy enough check file store requested path (local relative path packet manifest). update file store first, files guaranteed present. repository uses human readable archive, simplest thing request file remote. However, might efficient check locally previously fetched copies files content, verify modified, copy place rather re-downloading.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"marking-the-packet-as-unpacked-and-known-locally","dir":"Articles","previous_headings":"Adding a packet","what":"Marking the packet as unpacked and known locally","title":"Outpack metadata","text":"local location id, write file conforming location.json schema, containing packet id, time marked unpacked hash metadata.","code":".outpack//"},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"ordering-of-operations","dir":"Articles","previous_headings":"Adding a packet","what":"Ordering of operations","title":"Outpack metadata","text":"need files metadata packet marked unpacked; note configurations guarantee every packet unpacked complete tree. can import files first, metadata; lot disadvantage either. mark package unpacked known locally though components present.","code":""},{"path":[]},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"outpack-ids","dir":"Articles","previous_headings":"Details","what":"Outpack ids","title":"Outpack metadata","text":"Outpack ids match regular expression ^[0-9]{8}-[0-9]{6}-[0-9a-f]{8}$; encode UTC date-time prefix YYYYMMDD-HHMMSS- followed 8 hexadecimal digits. R implementation, encode current second first four digits (2 bytes) append 2 bytes cryptographically random data. id tries balance reasonable degree collision resistance (65536 combinations per millisecond), lexicographic sortability reasonable degree meaningfulness.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"location-ids","dir":"Articles","previous_headings":"Details","what":"Location ids","title":"Outpack metadata","text":"Location ids meaningless 4-byte (8 character) hex strings. immutable created different different machines even point location. location id mapped (via .outpack/config.json) location name human-readable name (e.g., production staging). requirement name different machines. One directories represents local location; can find mapping within configuration.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"representing-hashes","dir":"Articles","previous_headings":"Details","what":"Representing hashes","title":"Outpack metadata","text":"Outpack typically uses sha256 hashes, want able change future. wherever hash presented, algorithm included part string. example instead used md5 algorithm written schema currently assumes hash value represented hex string.","code":"sha256:69f6cf230416cf40828da251a0dad17cbbf078587883e826f3345ff08d1aaa7d md5:bd57f7123c6bfb95c3234ff56373b7f4"},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"times","dir":"Articles","previous_headings":"Details","what":"Times","title":"Outpack metadata","text":"store information times places (e.g., times packet run, imported, etc). Rather trying deal strings, always store time seconds since 1970-01-01 00:00.00 UTC (including fractional seconds, whatever accuracy system allows).","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/metadata.html","id":"file-store","dir":"Articles","previous_headings":"Details","what":"File store","title":"Outpack metadata","text":"file store designed simple, sophisticated git, whose object store similar thing. general layout looks like: hopefully fairly obvious structure. Paths format: reason second level prevent performance degradation directories containing millions files, copying git. store designed cope different hashing algorithms, though R implementation outpack supports sha256 now. Multiple hashing algorithms supported hard linking content multiple places tree, might link ","code":".outpack/files sha256/ 5d/ dfaf1f4a2e15e8fe46dbed145bf2f84bba1b3367d0a56f73de08f8585dd153 ... 77/ ... // sha256/5d/dfaf1f4a2e15e8fe46dbed145bf2f84bba1b3367d0a56f73de08f8585dd153 md5/84/0bc6ad3ae479dccc1c49a1910b37bd"},{"path":[]},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"so-long-yaml-and-thanks-for-all-the-whitespace-errors","dir":"Articles","previous_headings":"Summary of changes","what":"So long YAML and thanks for all the whitespace errors","title":"Migrating from orderly (1.x)","text":"obvious user-facing change (almost) YAML, definition inputs outputs report now defined within R script (orderly.R). orderly report previously orderly.yml file looked like end within orderly.R script looks like: think much clearer, comes documentation autocomplete support IDEs. fact, simple reports, special functions required, though ’ll find useful (see vignette(\"orderly2\")) specific changes: longer need list packages packages:, instead just use library() ordinary script. record state session regardless get record used longer need use sources: list scripts want source, instead use source() normal global_resources become orderly2::orderly_shared_resource (aren’t really global much shared). Note directory now always shared/ orderly root, may configure .","code":"parameters: n_min: default: 10 script: script.R source: - functions.R resources: - metadata.csv depends: raw_data: id: latest use: raw_data.csv: data.csv artefacts: data: description: Processed data filenames: data.rds orderly2::orderly_parameters(n_min = 10) orderly2::orderly_dependency(\"raw_data\", \"latest\", files = c(\"raw_data.csv\" = \"data.csv\")) orderly2::orderly_resource(\"metadata.csv\") orderly2::orderly_artefact(\"Processed data\", \"data.rds\") source(\"functions.R\")"},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"implications","dir":"Articles","previous_headings":"Summary of changes > So long YAML and thanks for all the whitespace errors","what":"Implications","title":"Migrating from orderly (1.x)","text":"change widespread implications: can program things like dependencies, creating loop series parameter values, conditionally depending reports R script can basis orderly report, can add orderly functions annotating inputs outputs progressively","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"database-support-has-been-moved-into-a-plugin","dir":"Articles","previous_headings":"Summary of changes","what":"Database support has been moved into a plugin","title":"Migrating from orderly (1.x)","text":"version 1, built-support accessing data SQL databases; moved within orderly.db plugin. major features supported.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"no-more-commit","dir":"Articles","previous_headings":"Summary of changes","what":"No more commit","title":"Migrating from orderly (1.x)","text":"orderly2 longer requires separate orderly_commit() call orderly_run(); longer make distinction local draft archive packets. Instead, added finer-grained control dependencies resolved (locally, subset servers), generalises way draft/archive used practice. See ?orderly_run details dependencies resolved. implications deleting things; draft directory always easy target deletion, now deletion need tell orderly2 deleted things. See vignette(\"introduction\") details (section “Deleting things archive”).","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"no-more-testing-or-development-mode","dir":"Articles","previous_headings":"Summary of changes","what":"No more testing or development mode","title":"Migrating from orderly (1.x)","text":"two different, unsatisfactory, mechanisms developing orderly report: orderly_test_start (version 1.1.0) orderly_develop_start (1.1.0 onwards) worked initial setup, copying dependencies etc location work (new draft orderly_test_start source directory orderly_develop_start). orderly2 can just work directly within source directory, long working directory set src/, orderly2 commands work expected. orderly1, need careful commit (git) results running analysis, encourage per-report .gitignore files help .","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"new-language-agnostic-backend","dir":"Articles","previous_headings":"Summary of changes","what":"New, language-agnostic, backend","title":"Migrating from orderly (1.x)","text":"biggest change, perhaps least visible, orderly now built open spec outpack can implemented language. develop Python implementation , possibly languages. takes control metadata. split “orderly_” “outpack_” functions package, information see last section vignette(\"introduction\") also vignette(\"outpack\").","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"other-smaller-changes","dir":"Articles","previous_headings":"Summary of changes","what":"Other, smaller changes","title":"Migrating from orderly (1.x)","text":"“Global” resources become “shared” resources, always live shared/ orderly root (.e., longer configurable). reason want reports able run fairly independently orderly2 configuration (exception plugins). practice people really vary .","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"what-is-missing-compared-with-orderly1","dir":"Articles","previous_headings":"","what":"What is missing compared with orderly1","title":"Migrating from orderly (1.x)","text":"changelog feature (implement something support ) extraction secrets vault (support ) automatic handling README files (may implement support )","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"how-to-migrate","dir":"Articles","previous_headings":"","what":"How to migrate","title":"Migrating from orderly (1.x)","text":"two parts migration: updating canonical copy orderly archive (ideally one ) updating source tree. steps done via outpack.orderly package. migrate archive first. every archive want retain (might archives stored locally, production servers staging servers). Archive migration happens place; , modify anything original location. archive old used old versions orderly1 possible process hiccups. Please let us know case. result process end new directory contains new archive conforming outpack spec containing orderly2 metadata. Next, migrate source tree. done place done fresh clone source git repository. report, examine orderly.yml files script files (often script.R), delete , write new orderly.R file adapt report work orderly2. possible perfect might need minor tweaking hopefully reasonable. One thing preserved (probably ) comments yaml often refer yaml formatting orderly1 features hopefully much problem. probably want manually tweak generated code anyway, take advantage new orderly2 features able compute dependencies. using OrderlyWeb, probably need pause migrating, replacement yet ready.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"what-about-the-packages","dir":"Articles","previous_headings":"","what":"What about the packages?","title":"Migrating from orderly (1.x)","text":"merge orderly2 orderly package, ready release can use . However, anticipate period coexistence legacy orderly1 systems develop orderly2. help small helper package orderly.helper can smooth namespace differences; may useful interact versions.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/migrating.html","id":"what-were-the-problems-in-version-1","dir":"Articles","previous_headings":"","what":"What were the problems in version 1","title":"Migrating from orderly (1.x)","text":"YAML format inflexible, error prone users, leads duplication focussed around initial needs Vaccine Impact Modelling Consortium fairly easy get archive SQLite database inconsistent state (e.g., deleting moving files archive) SQLite database behaved poorly shared file systems","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/orderly2.html","id":"collaborative-analysis","dir":"Articles","previous_headings":"","what":"Collaborative analysis","title":"orderly2","text":"Many analyses involve single person single machine; case number workflow tools make orchestrating analysis easy. workflow model graph dependencies analysis, data flows. example might update data, whole pipeline rerun. update code forecast, forecasts report rerun. experience, model works well single-user setting falls collaborative setting, especially analysis partitioned person; Alice handling data pipeline, Bob running fits, Carol organising forecasts final report. context, changes upstream affect downstream analysis, require set care around integration might used version controlling source code. example, Alice dealing change incoming data format going break analysis time Bob trying get model fits working, Bob trying integrate code changes Alice’s new data. typically deal source code using branches within git; code Bob work branch isolated Alice’s changes. contexts like () data analysis products git. needed way versioning outputs step analysis controlling integrated subsequent analyses. Another way looking problem seek way making analysis composable way functions OOP achieve programs, way docker containerisation achieved deploying software. need way putting interfaces around pieces analysis allow people refer fetch somewhere run. conceptual pieces needed : way referring unambiguously (globally) piece analysis can depended upon, everyone can agree ’re talking piece analysis system storage results running analysis can shared among group system control integration pieces analysis takes place refer transportable unit analysis “packet”. conceptually directory files created running code, atomic unit work point view orderly. packet underlying source form, anyone can run. However, time people use pre-run packets collaborators run inputs onward analyses (see vignette(\"dependencies\") vignette(\"collaboration\") details).","code":"[raw data] -> [processed data] -> [model fits] -> [forecasts] -> [report]"},{"path":"https://mrc-ide.github.io/orderly2/articles/orderly2.html","id":"reproducible-analyses","dir":"Articles","previous_headings":"","what":"Reproducible analyses","title":"orderly2","text":"degree collaboration style requires reproducibility, several aspects . system describe , even though everyone can typically run step analysis, typically don’t. differs workflow tools, users may familiar .","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/orderly2.html","id":"difference-from-a-workflow-system","dir":"Articles","previous_headings":"Reproducible analyses","what":"Difference from a workflow system","title":"orderly2","text":"Workflow systems hugely influential scientific computing, people co-opting build systems like make sophisticated systems designed parallel running large complex workflows nextflow. general approach define interdependencies among parts analysis, forming graph parts analysis track inputs outputs workflow. model computation lots good points: defines interface analysis allows (encourages) breaking monolithic analysis component pieces can reasoned allows high-level parallelism making obvious parts workflow can run concurrently tracking way data flows analysis, allows minimum amount recalculation done change, downstream parts triggered shared workspace online runner, allows degree collaboration long everyone happy working constantly changing set code analysis artefacts designed orderly2 working patterns suit . motivating reasons include: nodes computational graph expensive compute require exotic hardware. Workflows upstream data never settle, need know version data ends used particular analysis Workflows upstream analyses used many downstream analyses, upstream developer may know much downstream use Nondeterministic analyses, e.g., involving stochastic simulations, rerunning node expected return exact numerical results, can’t rely different users recovering results different occasions[*] cases missing piece need way versioning nodes within computational graph, shifting emphasis automatically rerunning portions graph tracking data flowed graph. turn shifts reproducibility emphasis “everyone run code get results” “everyone run code, instead work results”. familiar docker, approach similar working pre-built docker images, whereas workflow approach similar working directly Dockerfiles; many situations end result , approaches differ guarantees, computation happens, users refer versions. [*] discourage trying force determinism manually setting seeds, potential violate statistical properties random number streams, fragile best.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/orderly2.html","id":"what-is-reproducibility-anyway","dir":"Articles","previous_headings":"Reproducible analyses","what":"What is reproducibility anyway?","title":"orderly2","text":"Reproducibility means different things different people, even within narrow sense “rerun analysis retrieve results”. last decade, idea one able rerun piece analysis retrieve results slightly morphed one must rerun piece analysis. Similarly, emphasis utility reproducibility shifted authors able rerun work (confidence rerun ) hypothetical third party wanting rerun analysis. approach flips perspective around bit, based experiences collaborative research projects, draws (overly) ambitious aim : Can prove given set inputs produced given set outputs? quickly found impossible, provided systems place one satisfied statement given level trust system. piece analysis comes server primary way people run analyses web front-end (currently OrderlyWeb, soon Packit) know analysis run end--end modification orderly2 preserves inputs alongside outputs files present final packet files went analysis, recorded R package versions full set used. system naturally involves running multiple machines (typically analysts’ laptops, server perhaps HPC environment), way orderly2 treats paths, practically little problem getting analyses working multiple places, trivially satisfying typical reproducibility aim, even though people typically focussed . shift focus proved valuable. analysis run one occasion (e.g., regular reporting, simply updating figure final submission manuscript revision), outputs may change. Understanding changes happened important. orderly2 automatically saves lot metadata run easy find things might changed. , can start interrogating graph among packets find effect change ; find previously run packets pulled old version data set, used previous release package.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/plugins.html","id":"the-basic-idea","dir":"Articles","previous_headings":"","what":"The basic idea","title":"Creating plugins","text":"plugin provided package, possibly thing package provides. plugin name must (currently) package name. functions package needs call orderly2::orderly_plugin orderly2::orderly_plugin_register create register plugin, respectively. make plugin available orderly project, two new bits configuration may present orderly_config.yml - one declares plugin used, configures plugin. use plugin individual report, functions plugin used, configure use plugin. Finally, can save information back final orderly2 metadata plugin . yaml-less design orderly2 (see vignette(\"migrating\") familiar orderly1), line plugin just package code fairly blurred, reasons writing plugin typically want make something easier reports, want action reflected orderly metadata.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/plugins.html","id":"an-example","dir":"Articles","previous_headings":"","what":"An example","title":"Creating plugins","text":"example, ’ll implement stripped version database plugin inspired work (see `orderly.db fuller implementation). make work need functions: …process additional fields orderly_config.yml describe find database …can called orderly.R access database …can add metadata final orderly metadata done ’ll start report side things, describing want happen, work implementation. directory structure minimal project orderly_config.yml file contains information shared possible uses plugin - case connection information database: plugin called example.db listed within plugins section, along configuration; case indicating path SQLite file can loaded . orderly.R file contains information use database specific report; case, making results query SELECT * mtcars cyl == 4 database available R object dat Normally, imagine calculation kept minimal purpose demonstration. implement need : create package write function handle configuration orderly_config.yml write function query() used orderly.R query ","code":"## . ## ├── orderly_config.yml ## └── src ## └── example ## └── orderly.R minimum_orderly_version: 1.99.0 plugins: example.db: path: /tmp/RtmpYl7p4S/file1e923699f34e example.db::query(sql = \"SELECT * FROM mtcars WHERE cyl == 4\", as = \"dat\") orderly2::orderly_artefact(\"Summary of data\", \"data.rds\") saveRDS(summary(dat), \"data.rds\")"},{"path":"https://mrc-ide.github.io/orderly2/articles/plugins.html","id":"create-a-tiny-package","dir":"Articles","previous_headings":"An example","what":"Create a tiny package","title":"Creating plugins","text":"lots package skeleton tools , favourite, usethis::create_package() probably reasonable job. thing package needs contain Imports: orderly2 DESCRIPTION field. simple package may structure like , DESCRIPTION file contains: NAMESPACE R/plugin.R files shown .","code":"## . ## ├── DESCRIPTION ## ├── NAMESPACE ## └── R ## └── plugin.R Package: example.db Version: 0.0.1 License: CC0 Title: Orderly Database Example Plugin Description: Simple example of an orderly plugin. Authors@R: person('Orderly Authors', role = c('aut', 'cre'), email = 'email@example.com') Imports: orderly2"},{"path":"https://mrc-ide.github.io/orderly2/articles/plugins.html","id":"handle-the-configuration","dir":"Articles","previous_headings":"An example","what":"Handle the configuration","title":"Creating plugins","text":"required function plugin needs provide one process data orderly_config.yml. probably primarily concerned validation can fairly simple first, later ’ll expand report errors nicely: arguments data: deserialised section orderly_config.yml specific plugin filename: full path orderly_config.yml return value data argument auxiliary data added validation.","code":"db_config <- function(data, filename) { data }"},{"path":"https://mrc-ide.github.io/orderly2/articles/plugins.html","id":"evaluate-the-query","dir":"Articles","previous_headings":"An example","what":"Evaluate the query","title":"Creating plugins","text":"Finally, minimal example, need function actually query; example example.db::query: arguments whatever want user provide – nothing special orderly2. important function call orderly2::orderly_plugin_context returns information can use make plugin work. explained ?orderly2::orderly_plugin_context, example use two elements: config: configuration plugin (.e., return value function db_config) envir: (R) environment current packet using modify packet environment writing ctx$envir. Finally, return metadata save final packet metadata, return NULL, always empty. Later, ’ll show change . last bit package code register plugin, calling orderly2::orderly_plugin_register within .onLoad() special R function called package loaded. means whenever packages loaded (regardless whether attached) register plugin. (important name argument matches package name, orderly2 trigger loading package based name configuration; may support multiple plugins within one page later.) Note query function appear within registration, just function read process configuration. final (minimal) package code : NAMESPACE file contains","code":"query <- function(sql, as) { ctx <- orderly2::orderly_plugin_context(\"example.db\") dbname <- ctx$config$path con <- DBI::dbConnect(RSQLite::SQLite(), dbname) on.exit(DBI::dbDisconnect(con)) d <- DBI::dbGetQuery(con, sql) ctx$envir[[as]] <- d invisible() } .onLoad <- function(...) { orderly2::orderly_plugin_register( name = \"example.db\", config = db_config) } db_config <- function(data, filename) { data } query <- function(sql, as) { ctx <- orderly2::orderly_plugin_context(\"example.db\") dbname <- ctx$config$path con <- DBI::dbConnect(RSQLite::SQLite(), dbname) on.exit(DBI::dbDisconnect(con)) d <- DBI::dbGetQuery(con, sql) ctx$envir[[as]] <- d invisible() } .onLoad <- function(...) { orderly2::orderly_plugin_register( name = \"example.db\", config = db_config) } db_config <- function(data, filename) { data } query <- function(sql, as) { ctx <- orderly2::orderly_plugin_context(\"example.db\") dbname <- ctx$config$path con <- DBI::dbConnect(RSQLite::SQLite(), dbname) on.exit(DBI::dbDisconnect(con)) d <- DBI::dbGetQuery(con, sql) ctx$envir[[as]] <- d invisible() } .onLoad <- function(...) { orderly2::orderly_plugin_register( name = \"example.db\", config = db_config) }"},{"path":"https://mrc-ide.github.io/orderly2/articles/plugins.html","id":"trying-it-out","dir":"Articles","previous_headings":"An example","what":"Trying it out","title":"Creating plugins","text":"order test package, needs loaded. can either installing package using pkgload::load_all() (may find pkgload::load_all(export_all = FALSE) gives reliably experience. Now, can run report:","code":"pkgload::load_all() ## ℹ Loading example.db orderly2::orderly_run(\"example\", root = path_root) ## ℹ Starting packet 'example' `20231120-112053-5018f38e` at 2023-11-20 11:20:53.317514 ## > example.db::query(sql = \"SELECT * FROM mtcars WHERE cyl == 4\", as = \"dat\") ## > orderly2::orderly_artefact(\"Summary of data\", \"data.rds\") ## > saveRDS(summary(dat), \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231120-112053-5018f38e at 2023-11-20 11:20:53.416759 (0.09924531 secs) ## [1] \"20231120-112053-5018f38e\""},{"path":"https://mrc-ide.github.io/orderly2/articles/plugins.html","id":"making-the-plugin-more-robust","dir":"Articles","previous_headings":"","what":"Making the plugin more robust","title":"Creating plugins","text":"plugin fairly fragile validation input data orderly_config.yml orderly.yml. fairly annoying yaml incredibly flexible reporting back information user might gone wrong hard. case, expect single key-value pair orderly_config.yml key path value path SQLite database. can easily expand configuration function report better back user misconfigure plugin: acceptable job preventing poor input suggesting user might look within configuration fix . Note return configuration data , can augment (otherwise change) data need.","code":"db_config <- function(data, filename) { if (!is.list(data) || !is.null(names(data)) || length(data) == 0) { stop(\"Expected a named list for orderly_config.yml:example.db\") } if (length(data$path) != 1 || !is.character(data$path)) { stop(\"Expected a string for orderly_config.yml:example.db:path\") } if (!file.exists(data$path)) { stop(sprintf( \"The database '%s' does not exist (orderly_config:example.db:path)\", data$path)) } data }"},{"path":"https://mrc-ide.github.io/orderly2/articles/plugins.html","id":"saving-metadata-about-what-the-plugin-did","dir":"Articles","previous_headings":"","what":"Saving metadata about what the plugin did","title":"Creating plugins","text":"Nothing plugin saved report metadata unless save . Partly orderly.yml, saved final directory, serves sort record. However, probably want know something data returned . example might want save query string later can query without read process orderly.yml file statistics size data (e.g., number rows returned, columns) perhaps summary content hash can see content changed different versions report save metadata, use function orderly2::orderly_plugin_add_metadata; takes arguments plugin name, string like structure saved metadata (’ll use query) whatever data want save: function otherwise minimal version . also need provide serialisation function ensure metadata saved expected. saved metadata key query, get list back element query unnamed list many elements query calls given report. , ensure everything except cols length 1 (everything) gets turned scalar (1 [1]) serialise jsonlite::toJSON auto_unbox TRUE. Taking step , can also specify schema metadata conform save file inst/schema.json within package (path within inst fine). Now, register plugin, provide path schema, along serialisation function: Now, orderly metadata saved (just running script part report) validate output passed orderly2::orderly_plugin_add_metadata schema, jsonvalidate installed (currently requires development version) R option outpack.schema_validate set TRUE (e.g., running options(outpack.schema_validate = TRUE)). final package structure: DESCRIPTION file NAMESPACE unchanged , schema shown just . plugin.R file contains code collected : (code .R file package, across several).","code":"query <- function(sql, as) { ctx <- orderly2::orderly_plugin_context(\"example.db\") dbname <- ctx$config$path con <- DBI::dbConnect(RSQLite::SQLite(), dbname) on.exit(DBI::dbDisconnect(con)) d <- DBI::dbGetQuery(con, sql) ctx$envir[[as]] <- d info <- list(sql = sql, as = as, rows = nrow(d), cols = names(d)) orderly2::orderly_plugin_add_metadata(\"example.db\", \"query\", info) invisible() } orderly_db_serialise <- function(data) { for (i in seq_along(data$query)) { # Always save cols as a vector, even if length 1: data$query[[i]]$cols <- I(data$query[[i]]$cols) } jsonlite::toJSON(data, auto_unbox = TRUE) } { \"$schema\": \"http://json-schema.org/draft-07/schema#\", \"type\": \"object\", \"additionalProperties\": { \"type\": \"object\", \"properties\": { \"query\": { \"type\": \"string\" }, \"rows\": { \"type\": \"number\" }, \"cols\": { \"type\": \"array\", \"items\": { \"type\": \"character\" } } }, \"required\": [\"query\", \"rows\", \"cols\"], \"additionalProperties\": false } } .onLoad <- function(...) { orderly2::orderly_plugin_register( name = \"example.db\", config = db_config, serialise = db_serialise, schema = \"schema.json\") } ## . ## ├── archive ## │ └── example ## │ └── 20231120-112053-5018f38e ## │ ├── data.rds ## │ └── orderly.R ## ├── draft ## │ └── example ## ├── orderly_config.yml ## └── src ## └── example ## └── orderly.R db_config <- function(data, filename) { if (!is.list(data) || !is.null(names(data)) || length(data) == 0) { stop(\"Expected a named list for orderly_config.yml:example.db\") } if (length(data$path) != 1 || !is.character(data$path)) { stop(\"Expected a string for orderly_config.yml:example.db:path\") } if (!file.exists(data$path)) { stop(sprintf( \"The database '%s' does not exist (orderly_config:example.db:path)\", data$path)) } data } query <- function(sql, as) { ctx <- orderly2::orderly_plugin_context(\"example.db\") dbname <- ctx$config$path con <- DBI::dbConnect(RSQLite::SQLite(), dbname) on.exit(DBI::dbDisconnect(con)) d <- DBI::dbGetQuery(con, sql) ctx$envir[[as]] <- d info <- list(sql = sql, as = as, rows = nrow(d), cols = names(d)) orderly2::orderly_plugin_add_metadata(\"example.db\", \"query\", info) invisible() } .onLoad <- function(...) { orderly2::orderly_plugin_register( name = \"example.db\", config = db_config, serialise = db_serialise, schema = \"schema.json\") }"},{"path":"https://mrc-ide.github.io/orderly2/articles/plugins.html","id":"potential-uses","dir":"Articles","previous_headings":"","what":"Potential uses","title":"Creating plugins","text":"need functionality similar example - pulling database functionality original version orderly something independent, turns useful fraction orderly use-cases. can imagine potential uses though, : Non-DBI-based database data extraction, customised routines pulling data database Download files shared location just use (e.g., SharePoint, OneDrive, AWS). orderly_config.yml contain account connection details orderly.yml contain mapping remote data/files local files. Rather writing environment , use path argument copy files correct place. Pull data web API just running follow basic pattern requiring configuration order able connect resource service, specification resources fetched, action actually fetch resource put place.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/query.html","id":"structure-of-queries","dir":"Articles","previous_headings":"","what":"Structure of queries","title":"Orderly query DSL","text":"simple query finds recent packet; unlikely useful without scoping - see . complex queries expressed syntax valid R (also valid Julia close valid Python). complex query composed “tests” Every “test” uses boolean operator (<, >, <=, >=, ==, !=) left right hand side can one : lookup outpack metadata (parameter:x value parameter called x, name name packet, id id packet) lookup provided data pars (:x value pars$x) literal value (e.g., \"some_name\", 1, TRUE) Tests can grouped together (, !, &&, || might expect: parameter:x == 1 || parameter:x == 2 finds packets parameter x 1 2 name == \"data\" && parameter:x > 3 finds packets called “data” parameter x greater 3 (parameter:y == 2) && !(parameter:x == 1 || parameter:x == 2) finds parameter y 2 parameter x anything 1 2 (also written (parameter:y == 2) && (parameter:x != 1 && parameter:x != 2)) four functions latest(expr) finds latest packet satisfying expr - always returns length 1 character, NA_character_ suitable packet found. expr given latest packets returned. single(expr) like latest(expr) except error expr evaluate exactly one packet id usedby(expr, FALSE) expr either literal id expression returns 1 id. finds packets used generation packet id returned expr (see dependencies section details).","code":"latest() name == \"some_name\" parameter:x > 1"},{"path":"https://mrc-ide.github.io/orderly2/articles/query.html","id":"special-simple-queries","dir":"Articles","previous_headings":"","what":"Special simple queries","title":"Orderly query DSL","text":"two shorthand queries: latest equivalent latest() (useful applied scope) string matching regular expression id (^([0-9]{8}-[0-9]{6}-[[:xdigit:]]{8})$) equivalent single(id == \"\") \"\" string provided)","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/query.html","id":"scoping-queries","dir":"Articles","previous_headings":"","what":"Scoping queries","title":"Orderly query DSL","text":"WARNING: may remove Scoping queries can used shorthand filtering returned packets. future used reduce set packets searched speed query evaluation. join together main query (scope) && (expr), except expr call latest single. case combine latest((scope) && (expr)) single((scope) && (expr)). useful want limit search particular name location perform detailed search. example, query equivalent orderly2 uses functionality resolving dependencies orderly2::orderly_dependency.","code":"orderly_query(quote(parameter:x == 1), scope = quote(name == \"data\")) orderly_query(quote(parameter:x == 1 && name == \"data\"))"},{"path":"https://mrc-ide.github.io/orderly2/articles/query.html","id":"scoping-on-name","dir":"Articles","previous_headings":"Scoping queries","what":"Scoping on name","title":"Orderly query DSL","text":"often users want scope name instead passing scope argument shorthand name argument usability. equivalent ","code":"orderly_query(quote(parameter:x == 1), name = \"data\") orderly_query(quote(parameter:x == 1), scope = quote(name == \"data\"))"},{"path":"https://mrc-ide.github.io/orderly2/articles/query.html","id":"dependencies","dir":"Articles","previous_headings":"","what":"Dependencies","title":"Orderly query DSL","text":"2 packets, B depends output (.e. call (id_a, ...) running packet B) can draw . equivalently say dependency B, B depends used B , B uses parent B, B child tree dependencies among packets might want search packets used another packet. can use query function usedby(id) list packets used id. search recursively packets used id parents parents’ parents . optional second arg immediate FALSE default, set TRUE search immediate (e.g. level 1) dependencies. able search dependencies like means packet structure like want know id used C can find using orderly_search usedby can combined groupings scope: depth usedby recurse can controlled setting depth e.g. search just immediate parents C. depth can positive integer, default depth recurse finds parents. usedby can simplified using subqueries. Subqueries denoted curly braces {} can either named passed subquery arg can anonymous. query equivalent uses subquery C. two important things note usedby: query inside usedby search entire index, ignoring scope name parameters. want find packets used latest C. subquery C scoped return results. query inside usedby must return single result. ensure must either literal id, call latest call single well searching dependency tree using usedby can search uses function. setup reports , B C want know id C uses can find using uses usedby can combined search complex arrangements dependencies. something like want search version E depends version used latest C can via searches tree C tree find version E. Note important added name == \"\" condition , missing usedby(latest(name == \"C\")) also return B single throw error multiple packets. can also search tree find D e.g. note E packet uses D need add name == \"E\" clause. can combine usedby uses complex searches, find D C run","code":"orderly_search(quote(usedby(latest(name == \"C\"))), name = \"A\") orderly_search(quote(usedby(latest(name == \"C\")) && parameter:year == 2022), name = \"A\") orderly_search(quote(usedby(latest(name == \"C\"), depth = 1)), name = \"A\") orderly_search(quote(usedby({C}) && parameter:year == 2022), name = \"A\", subquery = list(C = quote(latest(name == \"C\")))) orderly_search(quote(uses(latest(name == \"A\"))), name = \"C\") orderly_search( quote(latest(uses(single(usedby(latest(name == \"C\")) && name == \"A\")))), name = \"E\") orderly_query( quote(usedby(single(uses(name == \"D\")))), name = \"A\", root = root) orderly_query( quote(usedby(single(uses(single(usedby(latest(name == \"C\")) && name == \"A\"))) && name == \"E\"))), name = \"D\", root = root)"},{"path":[]},{"path":"https://mrc-ide.github.io/orderly2/articles/query.html","id":"simple-things","dir":"Articles","previous_headings":"Possible future queries and interface improvements","what":"Simple things","title":"Orderly query DSL","text":"orderly1 supports .null(parameter:x) might generalise support However, Python None Julia nothing, complicates things. Alternatively use missing(parameter:x)?","code":"parameter:x == NULL"},{"path":"https://mrc-ide.github.io/orderly2/articles/query.html","id":"explain-the-query","dir":"Articles","previous_headings":"Possible future queries and interface improvements","what":"Explain the query","title":"Orderly query DSL","text":"Often, people want know “packet match”? good show query set packets fail query excluded. definitely bit work.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/troubleshooting.html","id":"outpack-files-accidentally-committed-to-git","dir":"Articles","previous_headings":"","what":"Outpack files accidentally committed to git","title":"Troubleshooting","text":"discussed orderly introduction, want commit files .outpack/, drafts/ archive/ (used) git create sorts problems line. directed , probably ended files git want undo situation. least painful way depends situation. now put guard rails try prevent happening, still happen modify .gitignore file force-add files example. situation, orderly2 shout : may directed page. just want continue working anyway, run suggested command: things work warning first time session: subsequent calls display warning: rest section discusses might permanently fix issue.","code":"orderly2::orderly_run(\"data\", root = path) ## Error in `orderly2::orderly_run()`: ## ! Detected 6 outpack files committed to git ## ✖ Detected files were found in '.outpack/' and 'archive/' ## ℹ For tips on resolving this, please see ## ## ℹ To turn this into a warning and continue anyway set the option ## 'orderly_git_error_is_warning' to TRUE by running ## options(orderly_git_error_is_warning = TRUE) options(orderly_git_error_is_warning = TRUE) orderly2::orderly_run(\"data\", root = path) ## Warning in orderly2::orderly_run(\"data\", root = path): Detected 6 outpack files committed to git ## ✖ Detected files were found in '.outpack/' and 'archive/' ## ℹ For tips on resolving this, please see ## ## This warning is displayed once per session. ## ✔ Wrote '.gitignore' ## ℹ Starting packet 'data' `20231120-112100-3a997447` at 2023-11-20 11:21:00.232053 ## > orderly2::orderly_artefact(\"Final data\", \"data.rds\") ## > saveRDS(mtcars, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231120-112100-3a997447 at 2023-11-20 11:21:00.265864 (0.03381062 secs) ## [1] \"20231120-112100-3a997447\" orderly2::orderly_run(\"data\", root = path) ## ℹ Starting packet 'data' `20231120-112100-59a385cc` at 2023-11-20 11:21:00.353258 ## > orderly2::orderly_artefact(\"Final data\", \"data.rds\") ## > saveRDS(mtcars, \"data.rds\") ## ✔ Finished running orderly.R ## ℹ Finished 20231120-112100-59a385cc at 2023-11-20 11:21:00.375651 (0.02239323 secs) ## [1] \"20231120-112100-59a385cc\""},{"path":"https://mrc-ide.github.io/orderly2/articles/troubleshooting.html","id":"i-dont-care-about-my-history-at-all","dir":"Articles","previous_headings":"Outpack files accidentally committed to git","what":"I don’t care about my history at all","title":"Troubleshooting","text":"case just started project, yet collaborating anyone else (person willing re-clone sources). simplest thing : Delete .git directory entirely Run orderly2::orderly_gitignore_update(\"(root)\") set reasonable .gitignore prevent situation happening Run git add . add everything back (review git status make sure ’re happy) Run git commit -m \"Initial commit\" create single commit contains files currently repo history, also .outpack files previously pushed repo GitHub similar need set git remote add origin https://github.com/user/repo (replacing user/repo path, using git@github.com:user/repo use ssh talk GitHub) git branch -M main assuming using main default branch, now common git push --force -u origin main Note destructive require coordination collaborators changed history.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/troubleshooting.html","id":"i-just-want-this-to-go-away-and-nothing-i-have-committed-is-very-large","dir":"Articles","previous_headings":"Outpack files accidentally committed to git","what":"I just want this to go away and nothing I have committed is very large","title":"Troubleshooting","text":"care history, also committed files (e.g., committed files .outpack/ small large 100MB file archive/ preventing pushing GitHub) just delete offending files git without updating history, affecting local copies. Run git rm --cached .outpack (repeating draft archive needed) Run orderly2::orderly_gitignore_update(\"(root)\") set reasonable .gitignore prevent situation happening Run git add .gitignore also stage Run git commit -m \"Delete unwanted outpack files\" can push without issues.","code":""},{"path":"https://mrc-ide.github.io/orderly2/articles/troubleshooting.html","id":"i-care-about-my-history-but-want-this-stuff-gone","dir":"Articles","previous_headings":"Outpack files accidentally committed to git","what":"I care about my history but want this stuff gone","title":"Troubleshooting","text":"working branch, unwanted files committed branch, simplest thing copy changes made somewhere safe, create new branch current main copy changes . somewhat automatically generating applying patch: unwanted files committed onto default branch, potentially gory history rewriting. See StackOverflow question, git docs currently recommended tool . Good luck!","code":"git diff -- src > changes.patch git checkout main git checkout -b changes-attempt2 git apply changes.patch git push -u origin changes-attempt2"},{"path":"https://mrc-ide.github.io/orderly2/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Rich FitzJohn. Author, maintainer. Robert Ashton. Author. Alex Hill. Author. Imperial College Science, Technology Medicine. Copyright holder.","code":""},{"path":"https://mrc-ide.github.io/orderly2/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"FitzJohn R, Ashton R, Hill (2023). orderly2: Orderly Next Generation. R package version 1.99.9, https://github.com/mrc-ide/orderly2.","code":"@Manual{, title = {orderly2: Orderly Next Generation}, author = {Rich FitzJohn and Robert Ashton and Alex Hill}, year = {2023}, note = {R package version 1.99.9}, url = {https://github.com/mrc-ide/orderly2}, }"},{"path":"https://mrc-ide.github.io/orderly2/index.html","id":"orderly2","dir":"","previous_headings":"","what":"Orderly Next Generation","title":"Orderly Next Generation","text":"attendant hospital responsible non-medical care patients maintenance order cleanliness. soldier carries orders performs minor tasks officer. orderly2 package designed help make analysis reproducible. principal aim automate series basic steps process writing analyses, making easy : track inputs analysis (packages, code, data resources) store multiple versions analysis repeated track outputs analysis create analyses depend outputs previous analyses","code":""},{"path":"https://mrc-ide.github.io/orderly2/index.html","id":"get-started","dir":"","previous_headings":"","what":"Get started","title":"Orderly Next Generation","text":"Two vignettes provide overview package, depending tastes: vignette(\"orderly2\") describes problem orderly2 tries solve (read package website) vignette(\"introduction\") describes orderly2 example, walking basic features (read package website)","code":""},{"path":"https://mrc-ide.github.io/orderly2/index.html","id":"roadmap","dir":"","previous_headings":"","what":"Roadmap","title":"Orderly Next Generation","text":"package ground-rewrite orderly package, now ready use new projects adventurous users original package. next months orderly renamed orderly1, finalise API package. stable, rename back orderly2 orderly release CRAN replace existing package. migration path existing users described vignette(\"migrating\") updated based experience migrating people. web framework OrderlyWeb rewritten parallel (packit) provide migration path .","code":""},{"path":"https://mrc-ide.github.io/orderly2/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Orderly Next Generation","text":"Please install r-universe: prefer, can install GitHub remotes:","code":"install.packages( \"orderly2\", repos = c(\"https://mrc-ide.r-universe.dev\", \"https://cloud.r-project.org\")) remotes::install_github(\"mrc-ide/orderly2\")"},{"path":"https://mrc-ide.github.io/orderly2/index.html","id":"testing","dir":"","previous_headings":"","what":"Testing","title":"Orderly Next Generation","text":"run tests, need outpack_server available system path. One way achieve run tests also require development versions gert jsonvalidate. can installed rOpenSci r-universe, : Without , tests skipped, suite still run.","code":"cargo install --git https://github.com/mrc-ide/outpack_server install.packages( c(\"gert\", \"jsonvalidate\"), repos = c(\"https://ropensci.r-universe.dev\", \"https://cloud.r-project.org\"))"},{"path":"https://mrc-ide.github.io/orderly2/index.html","id":"licence","dir":"","previous_headings":"","what":"Licence","title":"Orderly Next Generation","text":"MIT © Imperial College Science, Technology Medicine","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_artefact.html","id":null,"dir":"Reference","previous_headings":"","what":"Declare orderly artefacts — orderly_artefact","title":"Declare orderly artefacts — orderly_artefact","text":"Declare artefact. turn number orderly features; see Details . can multiple calls function within orderly script.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_artefact.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Declare orderly artefacts — orderly_artefact","text":"","code":"orderly_artefact(description, files)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_artefact.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Declare orderly artefacts — orderly_artefact","text":"description name artefact files files within artefact","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_artefact.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Declare orderly artefacts — orderly_artefact","text":"Undefined","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_artefact.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Declare orderly artefacts — orderly_artefact","text":"(1) files matching copied src directory draft directory unless also listed resource orderly_resource(). feature enabled call function top level orderly script contains string literals (variables). (2) script fails produce files, orderly_run() fail, guaranteeing task really produce things need . (3) within final metadata, artefacts additional metadata; description provide grouping","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_cleanup.html","id":null,"dir":"Reference","previous_headings":"","what":"Clean up source directory — orderly_cleanup","title":"Clean up source directory — orderly_cleanup","text":"Find, delete, file generated running report. comfortable , strongly recommended run orderly_cleanup_status first see deleted.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_cleanup.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clean up source directory — orderly_cleanup","text":"","code":"orderly_cleanup(name = NULL, dry_run = FALSE, root = NULL, locate = TRUE) orderly_cleanup_status(name = NULL, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_cleanup.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clean up source directory — orderly_cleanup","text":"name Name report directory clean (.e., look src/ relative orderly root dry_run Logical, indicating delete anything, instead just print information root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, just outpack (see orderly_init details). locate Logical, indicating configuration searched . TRUE config given, orderly looks working directory parents finds .outpack directory","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_cleanup.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Clean up source directory — orderly_cleanup","text":"(currently unstable) object class orderly_cleanup_status within element delete indicates files deleted (orderly_cleanup_status) deleted (orderly_cleanup)","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_cleanup.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Clean up source directory — orderly_cleanup","text":"file deletion, look remove empty directories; orderly2 similar semantics git directories never directly tracked. recent gert (yet CRAN) ask git files ignored; ignored good candidates deletion! encourage keep per-report .gitignore lists files copy source directory, can use information clean files generation. Importantly, even file matches ignore rule committed repository, longer match ignore rule.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_cleanup.html","id":"notes-for-user-of-orderly-","dir":"Reference","previous_headings":"","what":"Notes for user of orderly1","title":"Clean up source directory — orderly_cleanup","text":"orderly1 function quite different semantics, full set possible files always knowable yaml file. , start point view list files compare directory.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_cleanup.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Clean up source directory — orderly_cleanup","text":"","code":"# Create a simple example: path <- orderly2::orderly_example(\"default\") #> ✔ Created orderly root at '/tmp/Rtmpsi6m8X/file1a204c97013f' # We simulate running a packet interactively by using 'source'; # you might have run this line-by-line, or with the \"Source\" # button in Rstudio. source(file.path(path, \"src/data/orderly.R\"), chdir = TRUE) #> Warning: cannot open file '/tmp/Rtmpsi6m8X/file1a204c97013f/src/data/orderly.R': No such file or directory #> Error in file(filename, \"r\", encoding = encoding): cannot open the connection # Having run this, the output of the report is present in the # source directory: fs::dir_tree(path) #> Error: [ENOENT] Failed to search directory '/tmp/Rtmpsi6m8X/file1a204c97013f': no such file or directory # We can detect what might want cleaning up by running # \"orderly_cleanup_status\": orderly2::orderly_cleanup_status(\"data\", root = path) #> Error: Directory does not exist: '/tmp/Rtmpsi6m8X/file1a204c97013f' # Soon this will print more nicely to the screen, but for now you # can see that the status of \"data.rds\" is \"derived\", which means # that orderly knows that it is subject to being cleaned up; the # \"delete\" element shows what will be deleted. # Do the actual deletion: orderly2::orderly_cleanup(\"data\", root = path) #> Error: Directory does not exist: '/tmp/Rtmpsi6m8X/file1a204c97013f'"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config.html","id":null,"dir":"Reference","previous_headings":"","what":"Read configuration — orderly_config","title":"Read configuration — orderly_config","text":"Read current orderly configuration, stored within outpack root, along orderly-specific extensions.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read configuration — orderly_config","text":"","code":"orderly_config(root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read configuration — orderly_config","text":"root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read configuration — orderly_config","text":"list configuration options: core: important options outpack store, containing: path_archive: path human-readable packet archive, NULL disabled (set orderly_config_set core.path_archive) use_file_store: Indicates content-addressable file store enabled (core.use_file_store) require_complete_tree: Indicates outpack store requires dependencies fully available (core.require_complete_tree) hash_algorithm: hash algorithm used (currently modifiable) location: Information locations; see orderly_location_add, orderly_location_rename orderly_location_remove interact configuration, orderly_location_list simply list available locations. Returns data.frame columns name, id, priority, type args, args list column. orderly: list orderly-specific configuration; just minimum required version (minimum_orderly_version).","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read configuration — orderly_config","text":"","code":"# A default configuration in a new temporary directory path <- withr::local_tempdir() orderly2::orderly_init(path) #> ✔ Created orderly root at '/tmp/Rtmpsi6m8X/file1a20284d502' orderly2::orderly_config(path) #> $core #> $core$path_archive #> [1] \"archive\" #> #> $core$use_file_store #> [1] FALSE #> #> $core$require_complete_tree #> [1] FALSE #> #> $core$hash_algorithm #> [1] \"sha256\" #> #> #> $location #> name type args #> 1 local local #> #> $orderly #> $orderly$minimum_orderly_version #> [1] ‘1.99.0’ #> #>"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config_set.html","id":null,"dir":"Reference","previous_headings":"","what":"Set configuration options — orderly_config_set","title":"Set configuration options — orderly_config_set","text":"Set configuration options. can currently set; expanded time. See Details.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config_set.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set configuration options — orderly_config_set","text":"","code":"orderly_config_set(..., options = list(...), root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config_set.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set configuration options — orderly_config_set","text":"... Named options set (e.g., pass argument core.require_complete_tree = TRUE) options alternative ..., can pass list named options (e.g., list(core.require_complete_tree = TRUE)). interface typically easier program . root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config_set.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set configuration options — orderly_config_set","text":"Nothing","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config_set.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set configuration options — orderly_config_set","text":"Options set order provided. Currently, setting one option fails, options processed previous ones (rely behaviour, may change). Currently can set: core.require_complete_tree See orderly_init description options.","code":""},{"path":[]},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_config_set.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set configuration options — orderly_config_set","text":"","code":"# The default configuration does not include a file store, and # saves output within the \"archive\" directory: path <- withr::local_tempdir() orderly2::orderly_init(path) #> ✔ Created orderly root at '/tmp/Rtmpsi6m8X/file1a202ad54caf' fs::dir_tree(path, all = TRUE) #> /tmp/Rtmpsi6m8X/file1a202ad54caf #> ├── .outpack #> │ ├── config.json #> │ ├── location #> │ └── metadata #> └── orderly_config.yml # Change this after the fact: orderly2::orderly_config_set(core.use_file_store = TRUE, core.path_archive = NULL, root = path) fs::dir_tree(path, all = TRUE) #> /tmp/Rtmpsi6m8X/file1a202ad54caf #> ├── .outpack #> │ ├── config.json #> │ ├── files #> │ ├── index #> │ │ └── outpack.rds #> │ ├── location #> │ └── metadata #> └── orderly_config.yml"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_copy_files.html","id":null,"dir":"Reference","previous_headings":"","what":"Copy files from a packet — orderly_copy_files","title":"Copy files from a packet — orderly_copy_files","text":"Copy files packet anywhere. Similar orderly_dependency except used active packet context. can use function pull files outpack root directory outside control outpack, example. Note arguments need must provided name, position, exception id query.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_copy_files.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Copy files from a packet — orderly_copy_files","text":"","code":"orderly_copy_files( ..., files, dest, overwrite = TRUE, envir = parent.frame(), options = NULL, root = NULL, locate = TRUE )"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_copy_files.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Copy files from a packet — orderly_copy_files","text":"... Arguments passed orderly_query, perhaps just query expression files Files copy packet. can (1) character vector, case files copied without changing names, (2) named character vector, case name used destination name, (3) data.frame (including tbl_df, data.frame objects) containing columns , case files copied names . cases, want import directory files packet, must refer source trailing slash (e.g., c(= \"/\")), create local directory /... files upstream packet directory /. omit slash error thrown suggesting add slash intended. can use limited form string interpolation names argument; using ${variable} pick values envir substitute string. similar interpolation might familiar glue::glue similar, much simpler concatenation fancy features supported. Note unfortunate, (us) avoidable inconsistency ; interpolation values environment query done using environment:x destination filename ${x}. dest directory copy overwrite Overwrite files destination; typically want, set FALSE prefer error thrown destination file already exists. envir Optionally, environment substitute query (using environment: prefix). default use calling environment, can explicitly pass want control lookup happens. options Optionally, orderly_search_options object controlling search performed, packets considered scope. provided, default options used (.e., orderly2::orderly_search_options()) root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_copy_files.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Copy files from a packet — orderly_copy_files","text":"Nothing, invisibly. Primarily called side effect copying files packet directory dest","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_copy_files.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Copy files from a packet — orderly_copy_files","text":"can call function id string, case search packet proceed regardless whether id present. called arguments (e.g., string match id format, named argument name, subquery parameters) interpret arguments query orderly_search find id. error query return exactly one packet id, probably want use latest(). different ways might fail (recover failure): id known metadata store (known unpacked also known present remote) fail impossible resolve files. Consider refreshing metadata orderly_location_pull_metadata refresh . id unpacked local copy files referred can found, error default (see next option). However, sometimes file refer might also present downloaded packet depended , content file unchanged packet version locally. id unpacked, local copy file allow_remote TRUE try request file whatever remote selected orderly_location_pull_packet packet. Note empty directories might created failure.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_dependency.html","id":null,"dir":"Reference","previous_headings":"","what":"Declare a dependency — orderly_dependency","title":"Declare a dependency — orderly_dependency","text":"Declare dependency another packet","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_dependency.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Declare a dependency — orderly_dependency","text":"","code":"orderly_dependency(name, query, files)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_dependency.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Declare a dependency — orderly_dependency","text":"name name packet depend query query search ; often simply string latest, indicating recent version. may want complex query though. files Files copy packet. can (1) character vector, case files copied without changing names, (2) named character vector, case name used destination name, (3) data.frame (including tbl_df, data.frame objects) containing columns , case files copied names . cases, want import directory files packet, must refer source trailing slash (e.g., c(= \"/\")), create local directory /... files upstream packet directory /. omit slash error thrown suggesting add slash intended. can use limited form string interpolation names argument; using ${variable} pick values envir substitute string. similar interpolation might familiar glue::glue similar, much simpler concatenation fancy features supported. Note unfortunate, (us) avoidable inconsistency ; interpolation values environment query done using environment:x destination filename ${x}.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_dependency.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Declare a dependency — orderly_dependency","text":"Undefined","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_dependency.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Declare a dependency — orderly_dependency","text":"See orderly_run details search options used select locations packets found , data fetched network. running interactively, obviously work, use orderly_interactive_set_search_options() set options function respond .","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_description.html","id":null,"dir":"Reference","previous_headings":"","what":"Describe the current packet — orderly_description","title":"Describe the current packet — orderly_description","text":"Describe current packet","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_description.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Describe the current packet — orderly_description","text":"","code":"orderly_description(display = NULL, long = NULL, custom = NULL)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_description.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Describe the current packet — orderly_description","text":"display friendly name report; displayed locations web interface, packit. given, must scalar character. long longer description report. given, must scalar character. custom additional metadata. given, must named list, elements scalar atomics (character, number, logical).","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_description.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Describe the current packet — orderly_description","text":"Undefined","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_example.html","id":null,"dir":"Reference","previous_headings":"","what":"Copy a simple orderly example — orderly_example","title":"Copy a simple orderly example — orderly_example","text":"Copy simple orderly example use docs. function form part workflow!","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_example.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Copy a simple orderly example — orderly_example","text":"","code":"orderly_example(name, ..., dest = NULL)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_example.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Copy a simple orderly example — orderly_example","text":"name name example copy. Currently \"default\" supported. ... Arguments passed orderly_init() dest destination. default use withr::local_tempfile() create temporary directory clean . suitable use orderly examples, may prefer provide path. path must already exist.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_example.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Copy a simple orderly example — orderly_example","text":"Invisibly, path example.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_example.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Copy a simple orderly example — orderly_example","text":"","code":"path <- orderly2::orderly_example(\"default\") #> ✔ Created orderly root at '/tmp/Rtmpsi6m8X/file1a204a7f7f60' orderly2::orderly_list_src(root = path) #> Error: Directory does not exist: '/tmp/Rtmpsi6m8X/file1a204a7f7f60'"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_gitignore_update.html","id":null,"dir":"Reference","previous_headings":"","what":"Update a gitignore file — orderly_gitignore_update","title":"Update a gitignore file — orderly_gitignore_update","text":"Update gitignore, useful prevent accidentally committing files source control generated. includes artefacts, shared resources dependencies (within report directory) global level contents .outpack directory, draft folder archive directory.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_gitignore_update.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update a gitignore file — orderly_gitignore_update","text":"","code":"orderly_gitignore_update(name, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_gitignore_update.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update a gitignore file — orderly_gitignore_update","text":"name name gitignore file update, string \"(root)\" root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, just outpack (see orderly_init details). locate Logical, indicating configuration searched . TRUE config given, orderly looks working directory parents finds .outpack directory","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_gitignore_update.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Update a gitignore file — orderly_gitignore_update","text":"Nothing, called side effects","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_gitignore_update.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Update a gitignore file — orderly_gitignore_update","text":"function fails message edit '.gitignore', markers corrupted, look special markers within .gitignore file. look like edit file : lines appears file anything first two lines order get error message, search remove lines rerun.","code":"# ---VVV--- added by orderly ---VVV---------------- # Don't manually edit content between these markers ... patterns # ---^^^--- added by orderly ---^^^----------------"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_hash.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute a hash — orderly_hash_file","title":"Compute a hash — orderly_hash_file","text":"Use orderly2's hashing functions. intended advanced users, particular want create hashes consistent orderly2 within plugins. default behaviour use algorithm used orderly root (via root argument, usual root location approach). However, string provided algorithm can use alternative algorithm.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_hash.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute a hash — orderly_hash_file","text":"","code":"orderly_hash_file(path, algorithm = NULL, root = NULL, locate = TRUE) orderly_hash_data(data, algorithm = NULL, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_hash.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute a hash — orderly_hash_file","text":"path name file hash algorithm name algorithm use, overriding orderly root. root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml data string hash","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_hash.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute a hash — orderly_hash_file","text":"string format :","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_hash.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute a hash — orderly_hash_file","text":"","code":"orderly2::orderly_hash_data(\"hello\", \"md5\") #> [1] \"md5:5d41402abc4b2a76b9719d911017c592\""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_init.html","id":null,"dir":"Reference","previous_headings":"","what":"Initialise an orderly repository — orderly_init","title":"Initialise an orderly repository — orderly_init","text":"Initialise empty orderly repository, initialise source copy orderly repository (see Details). orderly repository defined presence file orderly_config.yml root, along directory .outpack/ level.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_init.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Initialise an orderly repository — orderly_init","text":"","code":"orderly_init( root = \".\", path_archive = \"archive\", use_file_store = FALSE, require_complete_tree = FALSE )"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_init.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Initialise an orderly repository — orderly_init","text":"root path initialise repository root . repository already initialised, operation checks options passed set repository (erroring ), otherwise nothing. default path current working directory. path_archive Path archive directory, used store human-readable copies packets. NULL, copy made, file_store must TRUE use_file_store Logical, indicating use content-addressable file-store source truth packets. archive non-NULL, file-store used source truth duplicated files archive exist convenience. require_complete_tree Logical, indicating require complete tree packets. currently affects orderly_location_pull_packet, requiring always operates recursive mode. FALSE default, set TRUE want archive behave well location; TRUE always packets hold metadata .","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_init.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Initialise an orderly repository — orderly_init","text":"full, normalised, path root, invisibly. Typically called side effect.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_init.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Initialise an orderly repository — orderly_init","text":"expected orderly_config.yml saved version control, .outpack excluded version control; means every clone project need call orderly2::orderly_init() initialise .outpack directory. forget , error thrown reminding need . can safely call orderly2::orderly_init() already-initialised directory, however, arguments passed must exactly match configuration current root, otherwise error thrown. Please use orderly_config_set change configuration, ensures change configuration possible. configuration options given match directory already uses, nothing happens. repository call orderly2::orderly_init() already initialised .outpack directory orderly_config.yml file, write file .","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_init.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Initialise an orderly repository — orderly_init","text":"","code":"# We'll use an automatically cleaned-up directory for the root: path <- withr::local_tempdir() # Initialise a new repository, setting an option: orderly2::orderly_init(path, use_file_store = TRUE) #> ✔ Created orderly root at '/tmp/Rtmpsi6m8X/file1a202cf70743' # fs::dir_tree(path, all = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_interactive_set_search_options.html","id":null,"dir":"Reference","previous_headings":"","what":"Set search options for interactive use — orderly_interactive_set_search_options","title":"Set search options for interactive use — orderly_interactive_set_search_options","text":"Set search options interactive use orderly; see orderly_dependency orderly_run details. may either orderly_search_options object, list coerced one point use (NULL). applies current session, applies interactive uses orderly functions might received copy search_options via orderly_run","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_interactive_set_search_options.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set search options for interactive use — orderly_interactive_set_search_options","text":"","code":"orderly_interactive_set_search_options(options = NULL)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_interactive_set_search_options.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set search options for interactive use — orderly_interactive_set_search_options","text":"options Optional control locations, used orderly_dependency; see Details section orderly_run.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_interactive_set_search_options.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set search options for interactive use — orderly_interactive_set_search_options","text":"Nothing, called side effects","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_list_src.html","id":null,"dir":"Reference","previous_headings":"","what":"List source reports — orderly_list_src","title":"List source reports — orderly_list_src","text":"List source reports - , directories within src/ contain file orderly.R","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_list_src.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List source reports — orderly_list_src","text":"","code":"orderly_list_src(root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_list_src.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List source reports — orderly_list_src","text":"root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, just outpack (see orderly_init details). locate Logical, indicating configuration searched . TRUE config given, orderly looks working directory parents finds .outpack directory","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_list_src.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List source reports — orderly_list_src","text":"character vector names source reports, suitable passing orderly_run","code":""},{"path":[]},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_list_src.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"List source reports — orderly_list_src","text":"","code":"path <- orderly2::orderly_example(\"default\") #> ✔ Created orderly root at '/tmp/Rtmpsi6m8X/file1a2057c61a9f' orderly2::orderly_list_src(root = path) #> Error: Directory does not exist: '/tmp/Rtmpsi6m8X/file1a2057c61a9f'"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_add.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a new location — orderly_location_add","title":"Add a new location — orderly_location_add","text":"Add new location - place packets might found pulled local archive. Currently file http based locations supported, limited support custom locations. Note adding location pull metadata , need call orderly_location_pull_metadata first.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_add.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a new location — orderly_location_add","text":"","code":"orderly_location_add(name, type, args, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_add.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a new location — orderly_location_add","text":"name short name location use. use, one local orphan type type location add. Currently supported values path (location exists elsewhere filesystem) http (location accessed outpack's http API). args Arguments location driver. arguments vary depending type used, see Details. root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_add.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a new location — orderly_location_add","text":"Nothing","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_add.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add a new location — orderly_location_add","text":"currently support two types locations - path, points outpack archive accessible path (e.g., computer mounted network share) http, requires outpack server running url uses HTTP API communicate. types may added later, configuration options location types definitely needed future. Configuration options different location types: Path locations: path: path archive root. generally absolute path, behaviour outpack unreliable. HTTP locations: Accessing outpack HTTP requires outpack server running. interface expected change expand API, also move support things like TLS authentication. url: location server, including protocol, example http://example.com:8080 Custom locations: outpack implementations expected support path http locations, standard arguments . expect implementations support custom locations, argument lists may vary implementations. allow , can pass location type \"custom\" list arguments. expect argument 'driver' present among list. example action, see outpack.sharepoint package. warned may change interface future, case may need update configuration.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_add.html","id":"warning","dir":"Reference","previous_headings":"","what":"Warning","title":"Add a new location — orderly_location_add","text":"API may change move support different types locations.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_list.html","id":null,"dir":"Reference","previous_headings":"","what":"List known pack locations — orderly_location_list","title":"List known pack locations — orderly_location_list","text":"List known locations.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List known pack locations — orderly_location_list","text":"","code":"orderly_location_list(root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List known pack locations — orderly_location_list","text":"root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List known pack locations — orderly_location_list","text":"character vector location names. special name local always present.","code":""},{"path":[]},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_pull_metadata.html","id":null,"dir":"Reference","previous_headings":"","what":"Pull metadata from a location — orderly_location_pull_metadata","title":"Pull metadata from a location — orderly_location_pull_metadata","text":"Pull metadata location, updating index. always relatively quick updates small files contain information can found remote packets.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_pull_metadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pull metadata from a location — orderly_location_pull_metadata","text":"","code":"orderly_location_pull_metadata(location = NULL, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_pull_metadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pull metadata from a location — orderly_location_pull_metadata","text":"location name location pull (see orderly_location_list possible values). given, pulls locations. \"local\" \"orphan\" locations always date pulling metadata nothing. root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_pull_metadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pull metadata from a location — orderly_location_pull_metadata","text":"Nothing","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_pull_packet.html","id":null,"dir":"Reference","previous_headings":"","what":"Pull a single packet from a location — orderly_location_pull_packet","title":"Pull a single packet from a location — orderly_location_pull_packet","text":"Pull one packets (including files) archive one locations. make files available use dependencies (e.g., orderly_dependency).","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_pull_packet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pull a single packet from a location — orderly_location_pull_packet","text":"","code":"orderly_location_pull_packet( ..., options = NULL, recursive = NULL, root = NULL, locate = TRUE )"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_pull_packet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pull a single packet from a location — orderly_location_pull_packet","text":"... Arguments passed orderly_search. special case first argument character vector ids named dot arguments, interpret argument vector ids directly. careful , query may pull lot data particular, passing NULL match everything every remote ! options Options passed orderly_search. option allow_remote must TRUE otherwise packet possibly pulled, error thrown FALSE. recursive non-NULL, logical, indicating recursively pull packets referenced packets specified id. might copy lot data! NULL, default value given configuration option require_complete_tree. root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_pull_packet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pull a single packet from a location — orderly_location_pull_packet","text":"Invisibly, ids packets pulled","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_pull_packet.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Pull a single packet from a location — orderly_location_pull_packet","text":"possible take long time pull packets, moving lot data operating slow connection. Cancelling resuming pull fairly efficient, keep track files copied even case interrupted pull.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_push.html","id":null,"dir":"Reference","previous_headings":"","what":"Push tree to location — orderly_location_push","title":"Push tree to location — orderly_location_push","text":"Push tree location. function works packets known location files required create . pushes files required build packets pushes missing metadata server. process interrupted safe resume transfer files packets missed previous call.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_push.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Push tree to location — orderly_location_push","text":"","code":"orderly_location_push(packet_id, location, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_push.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Push tree to location — orderly_location_push","text":"packet_id One packets push server location name location push (see orderly_location_list possible values). root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_push.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Push tree to location — orderly_location_push","text":"Invisibly, details information actually moved (might less requested, depending dependencies packets already known location).","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_remove.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove a location — orderly_location_remove","title":"Remove a location — orderly_location_remove","text":"Remove existing location. packets location known elsewhere now associated 'orphan' location instead.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_remove.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove a location — orderly_location_remove","text":"","code":"orderly_location_remove(name, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_remove.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove a location — orderly_location_remove","text":"name short name location. remove local orphan root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_remove.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove a location — orderly_location_remove","text":"Nothing","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_rename.html","id":null,"dir":"Reference","previous_headings":"","what":"Rename a location — orderly_location_rename","title":"Rename a location — orderly_location_rename","text":"Rename existing location","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_rename.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rename a location — orderly_location_rename","text":"","code":"orderly_location_rename(old, new, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_rename.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rename a location — orderly_location_rename","text":"old current short name location. rename local orphan new desired short name location. one local orphan root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_location_rename.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Rename a location — orderly_location_rename","text":"Nothing","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata.html","id":null,"dir":"Reference","previous_headings":"","what":"Read outpack metadata — orderly_metadata","title":"Read outpack metadata — orderly_metadata","text":"Read metadata particular id. may want use orderly_search find id corresponding particular query.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read outpack metadata — orderly_metadata","text":"","code":"orderly_metadata(id, root = NULL, locate = FALSE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read outpack metadata — orderly_metadata","text":"id id fetch metadata . error thrown id known root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read outpack metadata — orderly_metadata","text":"list metadata. See outpack schema details (https://github.com/mrc-ide/outpack)","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_extract.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract metadata from orderly2 packets — orderly_metadata_extract","title":"Extract metadata from orderly2 packets — orderly_metadata_extract","text":"Extract metadata group packets. experimental high-level function interacting metadata way hope useful. expand bit time goes , based feedback get let us know think. See Details use .","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_extract.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract metadata from orderly2 packets — orderly_metadata_extract","text":"","code":"orderly_metadata_extract(..., extract = NULL, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_extract.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract metadata from orderly2 packets — orderly_metadata_extract","text":"... Arguments passed orderly_search. special case first argument character vector ids named dot arguments, interpret argument vector ids directly. extract character vector columns extract, possibly named. See Details format. root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_extract.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract metadata from orderly2 packets — orderly_metadata_extract","text":"data.frame, columns vary based names extract; see Details information.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_extract.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extract metadata from orderly2 packets — orderly_metadata_extract","text":"Extracting data outpack metadata challenging way works data structures familiar R users, naturally tree structured, metadata may present packets (e.g., packet depend another dependency section, one run context without git git metadata). just want raw tree-structured data, can always use orderly_metadata load full metadata packet (even one currently available computer, just known ) structure data remain fairly constant across orderly2 versions. However, sometimes want extract data order ask specific questions like: parameter combinations available across range packets? particular set packets used? files packets produce? Later like ask even complex questions like: version file graph.png change? inputs changed versions? ...able answer questions requires similar approach interrogating metadata across range packets. orderly_metadata_extract function aims simplify process pulling bits metadata arranging data.frame (sorts) . little mini-language extract argument simple rewriting results, can always . order use function need know metadata available; expand vignette worked examples make easier understand. function works top-level keys, : id: packet id (always returned) name: packet name parameters: key-value pair values, string keys atomic values. guarantee presence keys packets, types. time: key-value pair times, string keys time values (see DateTimeClasses; stored seconds since 1970 actual metadata). present start end always present. files: files present packet. data.frame (per packet), columns path (relative), size (bytes) hash. depends: dependencies used packet. data.frame (per packet), columns packet (id), query (string, used find packet) files (another data.frame columns corresponding filenames upstream packet, respectively) git: either metadata state git null. given sha branch strings, url array strings/character vector (can zero, one elements). session: information session packet run (unstandardised, even orderly version may change) custom: additional metadata added respective engine. packets run orderly2, orderly field , list: artefacts: data.frame artefact information, containing columns description (string) paths (list column paths). shared: data.frame copied shared resources original name () name copied packet (). role: data.frame identified roles files, columns path role. description: list information orderly_description human-readable descriptions tags. session: list information session run, list platform containing information platform (R version version, operating system os system name system) packages containing columns package , version attached. nesting makes providing universally useful data format difficult; considering files data.frame files column, list data.frames; similar nestedness applies depends orderly custom data. However, able fairly easily process data format need . simplest extraction uses names top-level keys: creates data.frame columns corresponding keys, one row per packet. name always string, character vector, parameters files complex, list columns. must provide id; always returned always first character vector column. can rename columns providing name entries within extract, example: , except parameters column renamed pars. interestingly, can index structure like parameters; suppose want value parameter x, write: allowed packet parameters element list. However, know type x (might vary packets). can add information though write: create numeric column. packet value x non-integer, call orderly_metadata_extract fail error, packet lacks value x, missing value appropriate type added. Note coercion number, error non-NULL non-numeric value found. Valid types use boolean, number string (note differ slightly R's names want emphasise scalar quantities; also note integer may produce unexpected errors integer-like numeric values). can also use list default. Things schema known scalar atomics (name) automatically simplified. can index array-valued elements (files depends) way object-valued elements: get list column file names per packet another hashes, probably less useful data.frame get extracting just files longer hash information aligned. can index fairly deeply; possible get orderly \"display name\" : path need extract dot (likely package name plugin, custom.orderly.db) need escape dot backslash (, custom.orderly\\.db). probably need two slashes use raw string (recent versions R).","code":"extract = c(\"name\", \"parameters\", \"files\") extract = c(\"name\", pars = \"parameters\", \"files\") extract = c(x = \"parameters.x\") extract = c(x = \"parameters.x is number\") extract = c(file_path = \"files.path\", file_hash = \"files.hash\") extract = c(display = \"custom.orderly.description.display is string\")"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_extract.html","id":"custom-orderly-metadata","dir":"Reference","previous_headings":"","what":"Custom 'orderly' metadata","title":"Extract metadata from orderly2 packets — orderly_metadata_extract","text":"Within custom.orderly, additional fields can extracted. format subject change, stored metadata schema (short term) way deserialise . probably best rely right now, expand section can.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_read.html","id":null,"dir":"Reference","previous_headings":"","what":"Read outpack metadata json file — orderly_metadata_read","title":"Read outpack metadata json file — orderly_metadata_read","text":"Low-level function reading metadata deserialising . function can used directly read metadata json file without reference root contains . may useful context reading metadata file written part failed run.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_read.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read outpack metadata json file — orderly_metadata_read","text":"","code":"orderly_metadata_read(path)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_read.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read outpack metadata json file — orderly_metadata_read","text":"path Path json file","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_metadata_read.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read outpack metadata json file — orderly_metadata_read","text":"list outpack metadata; see schema details. contrast reading json file directly jsonlite::fromJSON, function take care convert scalar length-one vectors expected types.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_new.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a new report — orderly_new","title":"Create a new report — orderly_new","text":"Create new empty report.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_new.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a new report — orderly_new","text":"","code":"orderly_new(name, template = NULL, force = FALSE, root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_new.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a new report — orderly_new","text":"name name report template template use. acceptable values now NULL (uses built-default) FALSE suppresses default content. may support customisable templates future - let us know useful. force Create orderly.R file within existing directory src/; may useful already created directory files first want help creating orderly file. root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, just outpack (see orderly_init details). locate Logical, indicating configuration searched . TRUE config given, orderly looks working directory parents finds .outpack directory","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_new.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a new report — orderly_new","text":"Nothing, called side effects ","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Declare orderly parameters — orderly_parameters","title":"Declare orderly parameters — orderly_parameters","text":"Declare orderly parameters. one call within file, though enforced! Typically put close top, though order really matter. Parameters scalar atomic values (e.g. string, number boolean) defaults must present literally (.e., may come variable ). Provide NULL default, case parameter required.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Declare orderly parameters — orderly_parameters","text":"","code":"orderly_parameters(...)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Declare orderly parameters — orderly_parameters","text":"... number parameters","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_parameters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Declare orderly parameters — orderly_parameters","text":"Undefined","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_parameters.html","id":"behaviour-in-interactive-sessions","dir":"Reference","previous_headings":"","what":"Behaviour in interactive sessions","title":"Declare orderly parameters — orderly_parameters","text":"running interactively (.e., via source() running orderly.R session copy/paste Rstudio), orderly_parameters() function different behaviour. First, look current environment (likely global environment) values parameters - , variables bound names parameters. parameters found look default values use possible, possible either error prompt based global option orderly_interactive_parameters_missing_error. TRUE, ask enter value parameters (strings need entered quotes).","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_add_metadata.html","id":null,"dir":"Reference","previous_headings":"","what":"Add metadata from plugin — orderly_plugin_add_metadata","title":"Add metadata from plugin — orderly_plugin_add_metadata","text":"Add plugin-specific metadata running packet. take describing. accumulate number bits metadata arbitrary fields, later serialise json.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_add_metadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add metadata from plugin — orderly_plugin_add_metadata","text":"","code":"orderly_plugin_add_metadata(name, field, data)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_add_metadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add metadata from plugin — orderly_plugin_add_metadata","text":"name name plugin; must used orderly_plugin_register orderly_plugin_context field name field add data . required even plugin produces one sort data, case can remove later within serialisation function. data Arbitrary data added currently running packet","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_add_metadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add metadata from plugin — orderly_plugin_add_metadata","text":"Nothing, called side effects","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_context.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch plugin context — orderly_plugin_context","title":"Fetch plugin context — orderly_plugin_context","text":"Fetch running context, use within plugin. intention within free functions plugin makes available, call function get information state packet. typically call orderly_plugin_add_metadata() afterwards.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_context.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch plugin context — orderly_plugin_context","text":"","code":"orderly_plugin_context(name, envir)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_context.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch plugin context — orderly_plugin_context","text":"name Name plugin envir environment calling function. can typically pass parent.frame() (rlang::caller_env()) function calling orderly_plugin_context() function called user. argument effect interactive use (envir almost certainly global environment).","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_context.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fetch plugin context — orderly_plugin_context","text":"list elements: is_active: logical, indicating running orderly_run(); may need change behaviour depending value. path: path running packet. almost always working directory, unless packet contains calls setwd() similar. may create files . config: configuration plugin, processing plugin's read function (see orderly_plugin_register) envir: environment packet running . Often global environment, assume ! may read write environment. src: path packet source directory. different current directory packet running, user interactively working report. may read directory must write parameters: parameters passed run report.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_context.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fetch plugin context — orderly_plugin_context","text":"plugin function called, orderly2 running one two modes; (1) within orderly_run(), case part way creating packet brand new directory, possibly using special environment evaluation, (2) interactively, user developing report. plugin needs able support modes, function return information state help cope either case.","code":""},{"path":[]},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_register.html","id":null,"dir":"Reference","previous_headings":"","what":"Register an orderly plugin — orderly_plugin_register","title":"Register an orderly plugin — orderly_plugin_register","text":"Create orderly plugin. plugin typically defined package used extend orderly enabling new functionality, declared orderly_config.yml orderly.R affecting running reports primarily creating new objects report environment. system discussed detail vignette(\"plugins\"), expanded (likely breaking ways) soon.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_register.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Register an orderly plugin — orderly_plugin_register","text":"","code":"orderly_plugin_register( name, config, serialise = NULL, cleanup = NULL, schema = NULL )"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_register.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Register an orderly plugin — orderly_plugin_register","text":"name name plugin, typically package name config function read, check process configuration section orderly_config.yml. function passed deserialised data plugin's section orderly_config.yml, full path file. order loading plugins defined, plugin must standalone try interact plugins load. return processed copy configuration data, passed second argument read. serialise function serialise metadata added plugin's functions outpack metadata. passed list entries pushed via orderly_plugin_add_metadata(); named list names corresponding field argument orderly_plugin_add_metadata list element unnamed list values corresponding data. NULL, serialisation done, metadata plugin added. cleanup Optionally, function clean state plugin uses. can call orderly_plugin_context within function access anything need . given, cleanup done. schema Optionally path, within package, schema metadata created plugin; omit .json extension. file contains sources file inst/plugin/myschema.json pass plugin/myschema. See vignette(\"plugins\") details.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_plugin_register.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Register an orderly plugin — orderly_plugin_register","text":"Nothing, function called side effect registering plugin.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_prune_orphans.html","id":null,"dir":"Reference","previous_headings":"","what":"Prune orphan packet metadata — orderly_prune_orphans","title":"Prune orphan packet metadata — orderly_prune_orphans","text":"Prune orphan packets metadata store. function can used remove references packets longer reachable; happened deleted packet manually archive ran orderly_validate_archive removed location.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_prune_orphans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prune orphan packet metadata — orderly_prune_orphans","text":"","code":"orderly_prune_orphans(root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_prune_orphans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prune orphan packet metadata — orderly_prune_orphans","text":"root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_prune_orphans.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Prune orphan packet metadata — orderly_prune_orphans","text":"Invisibly, character vector orphaned packet ids","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_prune_orphans.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Prune orphan packet metadata — orderly_prune_orphans","text":"orphan packet used anywhere, can easily drop - never existed. referenced metadata know elsewhere locally, problem upstream location (one happen). referenced packet run locally, metadata deleted. expose function mostly users want expunge permanently reference previously run packets. hope never need really reason run .","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_query.html","id":null,"dir":"Reference","previous_headings":"","what":"Construct outpack query — orderly_query","title":"Construct outpack query — orderly_query","text":"Construct outpack query, typically passed orderly_search","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_query.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Construct outpack query — orderly_query","text":"","code":"orderly_query(expr, name = NULL, scope = NULL, subquery = NULL)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_query.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Construct outpack query — orderly_query","text":"expr query expression. NULL expression matches everything. name Optionally, name packet scope query . intersected scope arg shorthand way running scope = list(name = \"name\") scope Optionally, scope query limit packets searched pars subquery Optionally, named list subqueries can referenced name expr.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_query.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Construct outpack query — orderly_query","text":"orderly_query object, modified, can passed orderly_search()","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_query_explain.html","id":null,"dir":"Reference","previous_headings":"","what":"Explain a query — orderly_query_explain","title":"Explain a query — orderly_query_explain","text":"Explain query matched. experimental output change. moment, can tell query matches, fails match based one number &&-ed together clauses.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_query_explain.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Explain a query — orderly_query_explain","text":"","code":"orderly_query_explain( ..., parameters = NULL, envir = parent.frame(), options = NULL, root = NULL )"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_query_explain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Explain a query — orderly_query_explain","text":"... Arguments passed orderly_query, perhaps just query expression parameters Optionally, named list parameters substitute query (using : prefix) envir Optionally, environment substitute query (using environment: prefix). default use calling environment, can explicitly pass want control lookup happens. options Optionally, orderly_search_options object controlling search performed, packets considered scope. provided, default options used (.e., orderly2::orderly_search_options()) root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details).","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_query_explain.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Explain a query — orderly_query_explain","text":"object class orderly_query_explain, can inspected (contents subject change) print method show user-friendly summary query result.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_resource.html","id":null,"dir":"Reference","previous_headings":"","what":"Declare orderly resources — orderly_resource","title":"Declare orderly resources — orderly_resource","text":"Declare file, group files, orderly resource. explicitly declaring files resources orderly mark files immutable inputs validate analysis modify run orderly_run()","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_resource.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Declare orderly resources — orderly_resource","text":"","code":"orderly_resource(files)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_resource.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Declare orderly resources — orderly_resource","text":"files number names files","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_resource.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Declare orderly resources — orderly_resource","text":"Invisibly, character vector resources included call. rely order files expanded directories, likely platform dependent.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run.html","id":null,"dir":"Reference","previous_headings":"","what":"Run a report — orderly_run","title":"Run a report — orderly_run","text":"Run report. create new directory drafts/, copy declared resources , run script check expected artefacts created.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run a report — orderly_run","text":"","code":"orderly_run( name, parameters = NULL, envir = NULL, echo = TRUE, search_options = NULL, root = NULL, locate = TRUE, root_src = NULL )"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run a report — orderly_run","text":"name Name report run. leading ./ src/ trailing / path parts removed (e.g., added autocomplete). parameters Parameters passed report. named list parameters declared orderly.yml. parameter must scalar character, numeric, integer logical. envir environment used evaluate report script; default use global environment, may always wanted. echo Optional logical control printing output source() console. search_options Optional control locations, used orderly_dependency; converted orderly_search_options object, see Details. root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, just outpack (see orderly_init details). locate Logical, indicating configuration searched . TRUE config given, orderly looks working directory parents finds .outpack directory root_src Separately, root orderly source tree, separate outpack root (given root). intended running reports situations source tree kept different place outpack root; see Details information.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Run a report — orderly_run","text":"id created report (string)","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run.html","id":"locations-used-in-dependency-resolution","dir":"Reference","previous_headings":"","what":"Locations used in dependency resolution","title":"Run a report — orderly_run","text":"packet depends packets, want control locations used find appropriate packets. control passed function argument orderly_dependency property way packet created packet ; importantly different users may different names locations makes little sense encode location name source code. Alternatively, want use different locations different contexts (initial development want include local copies packets possible dependencies vs resolving dependencies resolved one locations! Similarly, might want include packets known locations currently downloaded onto machine - pulling packets take anything seconds hours depending size speed network connection (pulling packets mean packet fails run). allow control can pass argument search_options, orderly_search_options object, allows control names locations use, whether metadata refreshed pull anything packets currently downloaded considered candidates. effect running interactively, case can specify search options (root specific) orderly_interactive_set_search_options","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run.html","id":"which-packets-might-be-selected-from-locations-","dir":"Reference","previous_headings":"","what":"Which packets might be selected from locations?","title":"Run a report — orderly_run","text":"search_options argument controls outpack searches packets given query anything might moved network (one outpack archive another). default everything resolved locally ; can depend packets unpacked within current archive. pass search_options argument contains allow_remote = TRUE (see orderly_search_options packets known anywhere candidates using dependencies needed pull resolved files remote location. Note even packet locally present might needed - content anywhere else unpacked packet reuse content without re-fetching. pull_metadata = TRUE, refresh location metadata pulling, location argument controls locations pulled .","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run.html","id":"equivalence-to-the-old-use-draft-option","dir":"Reference","previous_headings":"","what":"Equivalence to the old use_draft option","title":"Run a report — orderly_run","text":"location handling generalises orderly (v1)'s old use_draft option, terms location argument orderly2::orderly_search_options`: use_draft = TRUE location = \"local\" use_draft = FALSE location = c(...) provide locations except local (setdiff(orderly2::orderly_location_list(), \"local\")) use_draft = \"newer\" location = NULL (last option one people preferred new default behaviour). addition, resolve dependencies currently exist production right now options: updates current metadata production, runs queries packets known remote, depends even (yet) locally. functionality never available orderly version 1, though intended support .","code":"location = \"production\", pull_metadata = TRUE, require_unpacked = FALSE"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run.html","id":"running-with-a-source-tree-separate-from-outpack-root","dir":"Reference","previous_headings":"","what":"Running with a source tree separate from outpack root","title":"Run a report — orderly_run","text":"Sometimes useful run things different place disk outpack root. know two cases come : running reports within runner server, make clean clone source tree particular git reference new temporary directory run report , insert orderly repo fixed non-temporary location. user convenient torun report hard drive store archive metadata (larger) shared drive. first instance, source path contains file orderly_config.yml directory src/ source reports, separate path contains directory .outpack/ metadata - may also unpacked archive, .git/ directory depending configuration. (Later make sense support \"bare\" outpack layout.)","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Run a report — orderly_run","text":"","code":"# Create a simple example: path <- orderly2::orderly_example(\"default\") #> ✔ Created orderly root at '/tmp/Rtmpsi6m8X/file1a2069e9a975' # Run the 'data' task: orderly2::orderly_run(\"data\", root = path) #> Error: Directory does not exist: '/tmp/Rtmpsi6m8X/file1a2069e9a975' # After running, a finished packet appears in the archive: fs::dir_tree(path) #> Error: [ENOENT] Failed to search directory '/tmp/Rtmpsi6m8X/file1a2069e9a975': no such file or directory # and we can query the metadata: orderly2::orderly_metadata_extract(name = \"data\", root = path) #> Error: Directory does not exist: '/tmp/Rtmpsi6m8X/file1a2069e9a975'"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run_info.html","id":null,"dir":"Reference","previous_headings":"","what":"Information about currently running report — orderly_run_info","title":"Information about currently running report — orderly_run_info","text":"Fetch information actively running report. allows reflect information report back part report, example embedding current report id, information computed dependencies. information slightly different format orderly version 1.x (currently) include information dependencies run outside orderly_run, never reliable previously.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run_info.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Information about currently running report — orderly_run_info","text":"","code":"orderly_run_info()"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_run_info.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Information about currently running report — orderly_run_info","text":"list elements name: name current report id: id current report, NA running interactively root: orderly root path depends: data frame information dependencies (available interactively) index: integer sequence along calls orderly_dependency name: name dependency query: query used find dependency id: computed id included packet filename: file used packet : filename used locally","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_search.html","id":null,"dir":"Reference","previous_headings":"","what":"Query outpack's database — orderly_search","title":"Query outpack's database — orderly_search","text":"Evaluate query outpack database, returning vector matching packet ids. Note default searches packets unpacked available direct use computer; search within packets known locations (might know via metadata) need use options argument.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_search.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Query outpack's database — orderly_search","text":"","code":"orderly_search( ..., parameters = NULL, envir = parent.frame(), options = NULL, root = NULL )"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_search.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query outpack's database — orderly_search","text":"... Arguments passed orderly_query, perhaps just query expression parameters Optionally, named list parameters substitute query (using : prefix) envir Optionally, environment substitute query (using environment: prefix). default use calling environment, can explicitly pass want control lookup happens. options Optionally, orderly_search_options object controlling search performed, packets considered scope. provided, default options used (.e., orderly2::orderly_search_options()) root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details).","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_search.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Query outpack's database — orderly_search","text":"character vector matching ids. case match query returning single value (e.g., latest(...) single(...)) character missing value (NA_character_)","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_search_options.html","id":null,"dir":"Reference","previous_headings":"","what":"Packet search options — orderly_search_options","title":"Packet search options — orderly_search_options","text":"Options controlling packet searches carried , example via orderly_search orderly_run. details never included metadata alongside query (, part query even though affect ).","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_search_options.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Packet search options — orderly_search_options","text":"","code":"orderly_search_options( location = NULL, allow_remote = FALSE, pull_metadata = FALSE )"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_search_options.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Packet search options — orderly_search_options","text":"location Optional vector locations pull . might future expand allow wildcards exceptions. allow_remote Logical, indicating allow packets found currently unpacked (.e., known location metadata ). TRUE, conjunction orderly_dependency might pull large quantity data. pull_metadata Logical, indicating pull metadata immediately search. location given, pass orderly_location_pull_metadata filter locations update. pulling many packets sequence, want update option FALSE first pull.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_search_options.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Packet search options — orderly_search_options","text":"object class orderly_search_options modified creation (see note pull_metadata)","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_shared_resource.html","id":null,"dir":"Reference","previous_headings":"","what":"Copy shared resources into a packet directory — orderly_shared_resource","title":"Copy shared resources into a packet directory — orderly_shared_resource","text":"Copy shared resources packet directory. can use share common resources (data code) multiple packets. Additional metadata added keep track files came . Using function requires shared resources directory shared/ exists orderly root; error raised configured attempt fetch files.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_shared_resource.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Copy shared resources into a packet directory — orderly_shared_resource","text":"","code":"orderly_shared_resource(...)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_shared_resource.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Copy shared resources into a packet directory — orderly_shared_resource","text":"... Named arguments corresponding shared resources copy. name destination filename, value filename within shared resource directory.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_shared_resource.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Copy shared resources into a packet directory — orderly_shared_resource","text":"Invisibly, data.frame columns (fileames copied running packet) (filenames within shared/). orderly_resource, rely ordering directory expansion performed.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_strict_mode.html","id":null,"dir":"Reference","previous_headings":"","what":"Enable orderly strict mode — orderly_strict_mode","title":"Enable orderly strict mode — orderly_strict_mode","text":"Put orderly2 \"strict mode\", closer defaults orderly 1.0.0; mode explicitly included files (via orderly_resource orderly_shared_resource) copied running packet, warn unexpected files end run. Using strict mode allows orderly2 aggressive deletes files within source directory, accurate reports , faster start packets developing interactively.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_strict_mode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Enable orderly strict mode — orderly_strict_mode","text":"","code":"orderly_strict_mode()"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_strict_mode.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Enable orderly strict mode — orderly_strict_mode","text":"Undefined","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_strict_mode.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Enable orderly strict mode — orderly_strict_mode","text":"future, may extend strict mode allow requiring computation occurs within orderly functions (.e., requirements run packet fully known actually running ). likely default behaviour orderly_strict_mode gain argument. allow server processes either override value (enabling even explicitly given) /require .","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_validate_archive.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate unpacked packets. — orderly_validate_archive","title":"Validate unpacked packets. — orderly_validate_archive","text":"Validate unpacked packets. time, expect function become fully featured, validating .","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_validate_archive.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate unpacked packets. — orderly_validate_archive","text":"","code":"orderly_validate_archive(..., action = \"inform\", root = NULL, locate = TRUE)"},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_validate_archive.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate unpacked packets. — orderly_validate_archive","text":"... Either arguments search can constructed (useful options include name = \"something\"), character vector ids, leave empty validate everything. action action take finding invalid packet. See Details. root path root directory, NULL (default) search one current working directory locate TRUE. function require directory configured orderly, can outpack root (see orderly_init details). locate Logical, indicating root searched . TRUE, looks directory given root (working directory NULL) parents finds .outpack directory orderly_config.yml","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_validate_archive.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate unpacked packets. — orderly_validate_archive","text":"Invisibly, character vector repaired (invalid) packets.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/orderly_validate_archive.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Validate unpacked packets. — orderly_validate_archive","text":"actions can take finding invalid packet : inform (default): just print information problem orphan: mark packet orphaned within metadata, touch files archive (default directory archive/) - safe option leave consistent state without deleting anything. delete: addition marking packet orphan, also delete files archive. Later, add \"repair\" option try fix broken packets. validation interacts option core.require_complete_tree; option TRUE, packet valid (recursive) dependencies also valid, action apply packets also upstream dependencies invalidated. validation happen even query implied ... include packets complete tree required. validation also interact core.use_file_store repair supported, becomes trivial.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":null,"dir":"Reference","previous_headings":"","what":"Query index — query_index","title":"Query index — query_index","text":"Class managing active index whilst evaluating query","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"Query index — query_index","text":"index packet index depends Named list data frames. Names packet ids, values packets depended packet id (.e. parents). uses Named list data frames. Names packet ids, values packets used packet id (.e. children). root outpack root object","code":""},{"path":[]},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Query index — query_index","text":"query_index$new() query_index$get_packet_depends() query_index$get_packet_uses()","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Query index — query_index","text":"Create new query_index object","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Query index — query_index","text":"","code":"query_index$new(root, index, depends, uses)"},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query index — query_index","text":"root outpack root object index packet index data frame depends Named list data frames. Names packet ids, values packets depended packet id (.e. parents). uses Named list data frames. Names packet ids, values packets used packet id (.e. children). data depends relationships flow direction.","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"method-get-packet-depends-","dir":"Reference","previous_headings":"","what":"Method get_packet_depends()","title":"Query index — query_index","text":"Get ids packets packet depends specified level","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Query index — query_index","text":"","code":"query_index$get_packet_depends(id, depth)"},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query index — query_index","text":"id id packet get parents depth Depth parents get, depth 1 gets immediate parents depth 2 gets parents parents parents, depth Inf recurse whole tree get parents","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Query index — query_index","text":"ids parents packet","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"method-get-packet-uses-","dir":"Reference","previous_headings":"","what":"Method get_packet_uses()","title":"Query index — query_index","text":"Get ids packets used packet","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Query index — query_index","text":"","code":"query_index$get_packet_uses(id, depth)"},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Query index — query_index","text":"id id packet get children depth Depth children get, depth 1 gets immediate children depth 2 gets children children children, depth Inf recurse whole tree get children","code":""},{"path":"https://mrc-ide.github.io/orderly2/reference/query_index.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"Query index — query_index","text":"ids children packet","code":""}]