diff --git a/404.html b/404.html index 4a128785..01627c76 100644 --- a/404.html +++ b/404.html @@ -24,7 +24,7 @@ orderly2 - 1.99.16 + 1.99.17
Create an orderly store with a file store and a complete tree. See
orderly2::orderly_init()
for more details.
id1 <- orderly2::orderly_run("data")
-## ℹ Starting packet 'data' `20240531-140519-b30f786b` at 2024-05-31 14:05:19.70282
+## ℹ Starting packet 'data' `20240611-121849-b5ffc99c` at 2024-06-11 12:18:49.714057
## > d <- read.csv("data.csv")
## > d$z <- resid(lm(y ~ x, d))
## > saveRDS(d, "data.rds")
## ✔ Finished running data.R
-## ℹ Finished 20240531-140519-b30f786b at 2024-05-31 14:05:19.743245 (0.04042506 secs)
id2 <- orderly2::orderly_run("analysis")
-## ℹ Starting packet 'analysis' `20240531-140519-c5ac59f4` at 2024-05-31 14:05:19.775262
+## ℹ Starting packet 'analysis' `20240611-121849-c708abf7` at 2024-06-11 12:18:49.780483
## > orderly2::orderly_dependency("data", "latest()", "data.rds")
-## ℹ Depending on data @ `20240531-140519-b30f786b` (via latest(name == "data"))
+## ℹ Depending on data @ `20240611-121849-b5ffc99c` (via latest(name == "data"))
## > d <- readRDS("data.rds")
## > png("analysis.png")
## > plot(y ~ x, d)
@@ -170,14 +170,14 @@ Basic use## agg_png
## 2
## ✔ Finished running analysis.R
-## ℹ Finished 20240531-140519-c5ac59f4 at 2024-05-31 14:05:19.851483 (0.07622075 secs)
When we look at the metadata for the packet created from the
analysis
report, we can see it has used
-20240531-140519-b30f786b
as its dependency:
20240611-121849-b5ffc99c
as its dependency:
orderly2::orderly_metadata(id2)$depends
## packet query files
-## 1 20240531-140519-b30f786b latest(name == "data") data.rds....
(indeed it had to, there is only one copy of the data
packet to pick from).
cyl
:
orderly2::orderly_run("data", list(cyl = 4))
-## ℹ Starting packet 'data' `20240531-140520-3a46186b` at 2024-05-31 14:05:20.230818
+## ℹ Starting packet 'data' `20240611-121850-45e462b7` at 2024-06-11 12:18:50.276085
## ℹ Parameters:
## • cyl: 4
## > orderly2::orderly_parameters(cyl = NULL)
## > d <- mtcars[mtcars$cyl == cyl, ]
## > saveRDS(d, "data.rds")
## ✔ Finished running data.R
-## ℹ Finished 20240531-140520-3a46186b at 2024-05-31 14:05:20.26411 (0.03329253 secs)
-## [1] "20240531-140520-3a46186b"
orderly2::orderly_run("data", list(cyl = 6))
-## ℹ Starting packet 'data' `20240531-140520-488ffbbd` at 2024-05-31 14:05:20.286543
+## ℹ Starting packet 'data' `20240611-121850-528b1eb5` at 2024-06-11 12:18:50.325351
## ℹ Parameters:
## • cyl: 6
## > orderly2::orderly_parameters(cyl = NULL)
## > d <- mtcars[mtcars$cyl == cyl, ]
## > saveRDS(d, "data.rds")
## ✔ Finished running data.R
-## ℹ Finished 20240531-140520-488ffbbd at 2024-05-31 14:05:20.317 (0.03045702 secs)
-## [1] "20240531-140520-488ffbbd"
orderly2::orderly_run("data", list(cyl = 8))
-## ℹ Starting packet 'data' `20240531-140520-56ce595a` at 2024-05-31 14:05:20.342176
+## ℹ Starting packet 'data' `20240611-121850-5f9e4c68` at 2024-06-11 12:18:50.376456
## ℹ Parameters:
## • cyl: 8
## > orderly2::orderly_parameters(cyl = NULL)
## > d <- mtcars[mtcars$cyl == cyl, ]
## > saveRDS(d, "data.rds")
## ✔ Finished running data.R
-## ℹ Finished 20240531-140520-56ce595a at 2024-05-31 14:05:20.369752 (0.02757645 secs)
-## [1] "20240531-140520-56ce595a"
Our follow-on analysis contains:
orderly2::orderly_parameters(cyl = NULL) @@ -250,7 +250,7 @@
).Filtering candidates by parametersthis:cyl
+## ℹ Finished 20240611-121850-8da82d38 at 2024-06-11 12:18:50.608357 (0.05191684 secs) +## [1] "20240611-121850-8da82d38"orderly2::orderly_run("analysis", list(cyl = 4)) -## ℹ Starting packet 'analysis' `20240531-140520-8638f23e` at 2024-05-31 14:05:20.527633 +## ℹ Starting packet 'analysis' `20240611-121850-8da82d38` at 2024-06-11 12:18:50.55644 ## ℹ Parameters: ## • cyl: 4 ## > orderly2::orderly_parameters(cyl = NULL) @@ -258,7 +258,7 @@
Filtering candidates by parameters## + "data", ## + "latest(parameter:cyl == this:cyl)", ## + "data.rds") -## ℹ Depending on data @ `20240531-140520-3a46186b` (via latest(parameter:cyl == this:cyl && name == "data")) +## ℹ Depending on data @ `20240611-121850-45e462b7` (via latest(parameter:cyl == this:cyl && name == "data")) ## > d <- readRDS("data.rds") ## > png("analysis.png") ## > plot(mpg ~ disp, d) @@ -266,8 +266,8 @@
Filtering candidates by parameters## agg_png ## 2 ## ✔ Finished running analysis.R -## ℹ Finished 20240531-140520-8638f23e at 2024-05-31 14:05:20.58356 (0.05592632 secs) -## [1] "20240531-140520-8638f23e"
orderly2::orderly_run("analysis", list(cyl = 9000))
-## ℹ Starting packet 'analysis' `20240531-140520-aab8c56e` at 2024-05-31 14:05:20.670046
+## ℹ Starting packet 'analysis' `20240611-121850-b0536448` at 2024-06-11 12:18:50.691779
## ℹ Parameters:
## • cyl: 9000
## > orderly2::orderly_parameters(cyl = NULL)
@@ -284,7 +284,7 @@ Interpreting errors## + "latest(parameter:cyl == this:cyl)",
## + "data.rds")
## ✖ Error running analysis.R
-## ℹ Finished 20240531-140520-aab8c56e at 2024-05-31 14:05:20.735463 (0.06541777 secs)
+## ℹ Finished 20240611-121850-b0536448 at 2024-06-11 12:18:50.752561 (0.06078267 secs)
## Error in `orderly2::orderly_run()`:
## ! Failed to run report
## Caused by error in `outpack_packet_use_dependency()`:
@@ -341,8 +341,8 @@ Interpreting errors## [1] 3
##
## $found
-## [1] "20240531-140520-3a46186b" "20240531-140520-488ffbbd"
-## [3] "20240531-140520-56ce595a"
(this would have worked with
rlang::last_error()$explanation$parts$A
too).
You can also use orderly2::orderly_metadata_extract
to
@@ -352,9 +352,9 @@
cyl
took in the evaluating environment.
Instead of a query, you can provide a single id (e.g,
-20240531-140520-8638f23e
), which would mean that even as
+20240611-121850-8da82d38
), which would mean that even as
new copies of the data
packet are created, this dependency
will always resolve to the same value.
You can chain together logical operations with
diff --git a/articles/index.html b/articles/index.html
index ce0aec29..61a42520 100644
--- a/articles/index.html
+++ b/articles/index.html
@@ -10,7 +10,7 @@
orderly2
- 1.99.16
+ 1.99.17
Creating an empty orderly reposito
path <- tempfile() # we'll use a temporary directory here - see note below
orderly2::orderly_init(path)
-## ✔ Created orderly root at '/tmp/RtmplUsFwH/file1aab604d1baf'
which creates a few files:
## . ## ├── .outpack @@ -183,15 +183,15 @@
:Creating your first orderly reportorderly2::orderly_run()
+## ℹ Finished 20240611-121853-dc541843 at 2024-06-11 12:18:53.924776 (0.05934334 secs)id <- orderly2::orderly_run("incoming_data") -## ℹ Starting packet 'incoming_data' `20240531-140523-fd46fffa` at 2024-05-31 14:05:23.994484 +## ℹ Starting packet 'incoming_data' `20240611-121853-dc541843` at 2024-06-11 12:18:53.865433 ## > d <- read.csv("data.csv") ## > d$z <- resid(lm(y ~ x, d)) ## > saveRDS(d, "data.rds") ## ✔ Finished running incoming_data.R -## ℹ Finished 20240531-140523-fd46fffa at 2024-05-31 14:05:24.056674 (0.06218958 secs)
id
-## [1] "20240531-140523-fd46fffa"
The id
that is created is a new identifier for the
packet that will be both unique among all packets (within reason) and
chronologically sortable. A packet that has an id that sorts after
@@ -200,7 +200,7 @@
## .
## ├── archive
## │ └── incoming_data
-## │ └── 20240531-140523-fd46fffa
+## │ └── 20240611-121853-dc541843
## │ ├── data.csv
## │ ├── data.rds
## │ └── incoming_data.R
@@ -213,7 +213,7 @@ Creating your first orderly report## └── incoming_data.R
A few things have changed here:
orderly2::orderly_run()
:
id <- orderly2::orderly_run("analysis")
-## ℹ Starting packet 'analysis' `20240531-140524-82af9c02` at 2024-05-31 14:05:24.513604
+## ℹ Starting packet 'analysis' `20240611-121854-656e3f84` at 2024-06-11 12:18:54.399326
## > orderly2::orderly_dependency("incoming_data", "latest()",
## + c("incoming.rds" = "data.rds"))
-## ℹ Depending on incoming_data @ `20240531-140523-fd46fffa` (via latest(name == "incoming_data"))
+## ℹ Depending on incoming_data @ `20240611-121853-dc541843` (via latest(name == "incoming_data"))
## > d <- readRDS("incoming.rds")
## > png("analysis.png")
## > plot(y ~ x, d)
@@ -296,7 +296,7 @@ Depending on packets from anot
## agg_png
## 2
## ✔ Finished running analysis.R
-## ℹ Finished 20240531-140524-82af9c02 at 2024-05-31 14:05:24.596151 (0.08254695 secs)
For more information on dependencies, see
vignette("dependencies")
.
id <- orderly2::orderly_run("incoming_data")
-## ℹ Starting packet 'incoming_data' `20240531-140524-ce02e66a` at 2024-05-31 14:05:24.80663
+## ℹ Starting packet 'incoming_data' `20240611-121854-aefeb7e6` at 2024-06-11 12:18:54.685393
## > orderly2::orderly_strict_mode()
## > orderly2::orderly_resource("data.csv")
## > orderly2::orderly_artefact("Processed data", "data.rds")
@@ -378,7 +378,7 @@ Available in-report orderly comman
## > d$z <- resid(lm(y ~ x, d))
## > saveRDS(d, "data.rds")
## ✔ Finished running incoming_data.R
-## ℹ Finished 20240531-140524-ce02e66a at 2024-05-31 14:05:24.835619 (0.02898979 secs)
id <- orderly2::orderly_run("random", list(n_samples = 15))
-## ℹ Starting packet 'random' `20240531-140525-0c51d5b4` at 2024-05-31 14:05:25.051334
+## ℹ Starting packet 'random' `20240611-121854-ec525cf0` at 2024-06-11 12:18:54.926169
## ℹ Parameters:
## • n_samples: 15
## > orderly2::orderly_parameters(n_samples = 10)
@@ -428,7 +428,7 @@ Parameterised reports## > d <- data.frame(x = x, y = x + rnorm(n_samples))
## > saveRDS(d, "data.rds")
## ✔ Finished running random.R
-## ℹ Finished 20240531-140525-0c51d5b4 at 2024-05-31 14:05:25.081436 (0.03010201 secs)
Our resulting file has 15 rows, as the parameter we passed in affected the report:
@@ -455,11 +455,11 @@Parameterised reports
+## [1] "20240611-121854-ec525cf0"orderly2::orderly_search('latest(name == "random")') -## [1] "20240531-140525-0c51d5b4"
But we can also pass in parameter queries here:
orderly2::orderly_search('latest(name == "random" && parameter:n_samples > 10)')
-## [1] "20240531-140525-0c51d5b4"
These can be used within orderly2::orderly_dependency()
(the name == "random"
part is implied by the first
name
argument), for example
## .
## ├── archive
## │ ├── analysis
-## │ │ └── 20240531-140524-82af9c02
+## │ │ └── 20240611-121854-656e3f84
## │ │ ├── analysis.R
## │ │ ├── analysis.png
## │ │ └── incoming.rds
## │ ├── incoming_data
-## │ │ ├── 20240531-140523-fd46fffa
+## │ │ ├── 20240611-121853-dc541843
## │ │ │ ├── data.csv
## │ │ │ ├── data.rds
## │ │ │ └── incoming_data.R
-## │ │ └── 20240531-140524-ce02e66a
+## │ │ └── 20240611-121854-aefeb7e6
## │ │ ├── data.csv
## │ │ ├── data.rds
## │ │ └── incoming_data.R
## │ └── random
-## │ └── 20240531-140525-0c51d5b4
+## │ └── 20240611-121854-ec525cf0
## │ ├── data.rds
## │ └── random.R
## ├── draft
@@ -536,7 +536,7 @@ Shared resourcesWe can run this:
id <- orderly2::orderly_run("use_shared")
-## ℹ Starting packet 'use_shared' `20240531-140525-8c20dea9` at 2024-05-31 14:05:25.550596
+## ℹ Starting packet 'use_shared' `20240611-121855-6894388c` at 2024-06-11 12:18:55.411631
## > orderly2::orderly_shared_resource("data.csv")
## > orderly2::orderly_artefact("analysis", "analysis.png")
## > d <- read.csv("data.csv")
@@ -546,11 +546,11 @@ Shared resources## agg_png
## 2
## ✔ Finished running use_shared.R
-## ℹ Finished 20240531-140525-8c20dea9 at 2024-05-31 14:05:25.585678 (0.03508162 secs)
+## ℹ Finished 20240611-121855-6894388c at 2024-06-11 12:18:55.444708 (0.033077 secs)
In the resulting archive, the file that was used from the shared directory is present:
## archive/use_shared
-## └── 20240531-140525-8c20dea9
+## └── 20240611-121855-6894388c
## ├── analysis.png
## ├── data.csv
## └── use_shared.R
@@ -644,49 +644,49 @@ When we run the analysis
task, it will pull in the most
-recent version (20240531-140524-ce02e66a
). However, if you
+recent version (20240611-121854-aefeb7e6
). However, if you
had deleted this manually (e.g., to save space or accidentally) or
corrupted it (e.g., by opening some output in Excel and letting it save
changes) it will not be able to be included, and running
analysis
will fail:
orderly2::orderly_run("analysis")
-## ℹ Starting packet 'analysis' `20240531-140526-2b827c6c` at 2024-05-31 14:05:26.173082
+## ℹ Starting packet 'analysis' `20240611-121856-02f98199` at 2024-06-11 12:18:56.014657
## > orderly2::orderly_dependency("incoming_data", "latest()",
## + c("incoming.rds" = "data.rds"))
## ✖ Error running analysis.R
-## ℹ Finished 20240531-140526-2b827c6c at 2024-05-31 14:05:26.253683 (0.08060122 secs)
+## ℹ Finished 20240611-121856-02f98199 at 2024-06-11 12:18:56.090559 (0.07590199 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 20240531-140524-ce02e66a
-## ℹ Consider 'orderly2::orderly_validate_archive("20240531-140524-ce02e66a",
+## ! Unable to copy files, due to deleted packet 20240611-121854-aefeb7e6
+## ℹ Consider 'orderly2::orderly_validate_archive("20240611-121854-aefeb7e6",
## action = "orphan")' to remove this packet from consideration
## Caused by error:
## ! File not found in archive
## ✖ data.rds
The error here tries to be fairly informative, telling us that we
failed because when copying files from
-20240531-140524-ce02e66a
we found that the packet was
+20240611-121854-aefeb7e6
we found that the packet was
corrupt, because the file data.rds
was not found in the
archive. It also suggests a fix; we can tell orderly2
that
-20240531-140524-ce02e66a
is “orphaned” and should not be
+20240611-121854-aefeb7e6
is “orphaned” and should not be
considered for inclusion when we look for dependencies.
We can carry out the suggestion and just validate this packet by running
-orderly2::orderly_validate_archive("20240531-140524-ce02e66a", action = "orphan")
orderly2::orderly_validate_archive("20240611-121854-aefeb7e6", action = "orphan")
or we can validate all the packets we have:
orderly2::orderly_validate_archive(action = "orphan")
-## ✔ 20240531-140523-fd46fffa (incoming_data) is valid
-## ✔ 20240531-140524-82af9c02 (analysis) is valid
-## ✖ 20240531-140524-ce02e66a (incoming_data) is invalid due to its files
-## ✔ 20240531-140525-0c51d5b4 (random) is valid
-## ✔ 20240531-140525-8c20dea9 (use_shared) is valid
If we had the option core.require_complete_tree
enabled,
then this process would also look for any packets that used our
now-deleted packet and orphan those too, as we no longer have a complete
@@ -773,16 +773,16 @@
As can be perhaps inferred from the filenames, the files
.outpack/metadata/<packet-id>
are the metadata for
each packet as it has been run. The files
@@ -822,16 +822,16 @@
The files under Our plugin is called subsequent calls will not display the warning: The rest of this section discusses how you might permanently fix the
issue. FitzJohn R, Ashton R, Hill A (2024).
orderly2: Orderly Next Generation.
-R package version 1.99.16, https://github.com/mrc-ide/orderly2.
+R package version 1.99.17, https://github.com/mrc-ide/orderly2.
.outpack/files/
should never be modified
or deleted. This approach to storage naturally deduplicates the file
archive, so that a large file used in many places is only ever stored
diff --git a/articles/metadata.html b/articles/metadata.html
index 2f84c853..cb4406cc 100644
--- a/articles/metadata.html
+++ b/articles/metadata.html
@@ -26,7 +26,7 @@
orderly2
- 1.99.16
+ 1.99.17
An example
+ path: /tmp/Rtmpzhwfug/file1cb335e00d2
minimum_orderly_version: 1.99.0
plugins:
example.db:
- path: /tmp/RtmpRDH1pt/file1b9d3a88cadd
example.db
and is listed within the
plugins
section, along with its configuration; in this case
indicating the path where the SQLite file can be loaded from.Trying it out
+## ℹ Finished 20240611-121904-22f955fa at 2024-06-11 12:19:04.232886 (0.09188581 secs)
+## [1] "20240611-121904-22f955fa"
orderly2::orderly_run("example", root = path_root)
-## ℹ Starting packet 'example' `20240531-140534-c9cbfcc5` at 2024-05-31 14:05:34.79273
+## ℹ Starting packet 'example' `20240611-121904-22f955fa` at 2024-06-11 12:19:04.141001
## > dat <- example.db::query("SELECT * FROM mtcars WHERE cyl == 4")
## > orderly2::orderly_artefact("Summary of data", "data.rds")
## > saveRDS(summary(dat), "data.rds")
## ✔ Finished running example.R
-## ℹ Finished 20240531-140534-c9cbfcc5 at 2024-05-31 14:05:34.889977 (0.09724665 secs)
-## [1] "20240531-140534-c9cbfcc5"
Saving metadata about what th
## .
## ├── archive
## │ └── example
-## │ └── 20240531-140534-c9cbfcc5
+## │ └── 20240611-121904-22f955fa
## │ ├── data.rds
## │ └── example.R
## ├── draft
@@ -501,12 +501,12 @@
Saving metadata about what th
several).
id <- orderly2::orderly_run("example", root = path_root)
-## ℹ Starting packet 'example' `20240531-140535-db6870b5` at 2024-05-31 14:05:35.860351
+## ℹ Starting packet 'example' `20240611-121905-2c84bccf` at 2024-06-11 12:19:05.17701
## > dat <- example.db::query("SELECT * FROM mtcars WHERE cyl == 4")
## > orderly2::orderly_artefact("Summary of data", "data.rds")
## > saveRDS(summary(dat), "data.rds")
## ✔ Finished running example.R
-## ℹ Finished 20240531-140535-db6870b5 at 2024-05-31 14:05:35.909041 (0.04869008 secs)
meta <- orderly2::orderly_metadata(id, root = path_root)
meta$custom$example.db
diff --git a/articles/query.html b/articles/query.html
index e3d0114e..44822b04 100644
--- a/articles/query.html
+++ b/articles/query.html
@@ -26,7 +26,7 @@
orderly2
- 1.99.16
+ 1.99.17
Outpack files accidentally
## <https://mrc-ide.github.io/orderly2/articles/troubleshooting.html>
## This warning is displayed once per session.
-## ✔ Wrote '.gitignore'
+## ℹ Starting packet 'data' `20240531-140542-16532547` at 2024-05-31 14:05:42.090323
## ℹ Starting packet 'data' `20240611-121911-91f695da` at 2024-06-11 12:19:11.573209
## > orderly2::orderly_artefact("Final data", "data.rds")
## > saveRDS(mtcars, "data.rds")
-## ✔ Finished running data.R
-## ℹ Finished 20240531-140542-16532547 at 2024-05-31 14:05:42.127548 (0.03722477 secs)
+## [1] "20240531-140542-16532547"
+## ℹ Finished 20240611-121911-91f695da at 2024-06-11 12:19:11.609379 (0.03617024 secs)
## [1] "20240611-121911-91f695da"
orderly2::orderly_run("data")
+## ℹ Starting packet 'data' `20240531-140542-36c29e4b` at 2024-05-31 14:05:42.217086
## ℹ Starting packet 'data' `20240611-121911-b19b31c6` at 2024-06-11 12:19:11.696782
## > orderly2::orderly_artefact("Final data", "data.rds")
## > saveRDS(mtcars, "data.rds")
-## ✔ Finished running data.R
-## ℹ Finished 20240531-140542-36c29e4b at 2024-05-31 14:05:42.242944 (0.02585864 secs)
+## [1] "20240531-140542-36c29e4b"
+## ℹ Finished 20240611-121911-b19b31c6 at 2024-06-11 12:19:11.720755 (0.02397323 secs)
## [1] "20240611-121911-b19b31c6"
Citation
@Manual{,
title = {orderly2: Orderly Next Generation},
author = {Rich FitzJohn and Robert Ashton and Alex Hill},
year = {2024},
- note = {R package version 1.99.16},
+ note = {R package version 1.99.17},
url = {https://github.com/mrc-ide/orderly2},
}
Notes for user of orderly1Examples
# Create a simple example:
path <- orderly2::orderly_example("default")
-#> ✔ Created orderly root at '/tmp/RtmpqY7Y9D/file171a719e8839'
+#> ✔ Created orderly root at '/tmp/Rtmpxn43nv/file18351ed651d0'
# 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/data.R"), chdir = TRUE)
-#> Warning: cannot open file '/tmp/RtmpqY7Y9D/file171a719e8839/src/data/data.R': No such file or directory
+#> Warning: cannot open file '/tmp/Rtmpxn43nv/file18351ed651d0/src/data/data.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/RtmpqY7Y9D/file171a719e8839': no such file or directory
+#> Error: [ENOENT] Failed to search directory '/tmp/Rtmpxn43nv/file18351ed651d0': 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/RtmpqY7Y9D/file171a719e8839'
+#> Error: Directory does not exist: '/tmp/Rtmpxn43nv/file18351ed651d0'
# 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/RtmpqY7Y9D/file171a719e8839'
+#> Error: Directory does not exist: '/tmp/Rtmpxn43nv/file18351ed651d0'