From 9761b7a5283ceaf83b9abc36b094cd3168d13073 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Tue, 4 Jul 2023 08:39:46 +0100 Subject: [PATCH 1/6] Rename package from orderly to orderly1 --- DESCRIPTION | 4 +- R/batch.R | 10 +-- R/bundle.R | 16 ++--- R/cleanup.R | 22 +++---- R/config.R | 4 +- R/db.R | 24 +++---- R/db2.R | 6 +- R/deduplicate.R | 8 +-- R/dependencies.R | 24 +++---- R/develop.R | 16 ++--- R/helpers.R | 8 +-- R/info.R | 10 +-- R/init.R | 10 +-- R/logging.R | 18 +++--- R/migrate.R | 6 +- R/new.R | 6 +- R/query.R | 62 +++++++++--------- R/query_search.R | 22 +++---- R/recipe_commit.R | 10 +-- R/recipe_run.R | 30 ++++----- R/recipe_test.R | 14 ++-- R/remote.R | 48 +++++++------- R/remote_path.R | 4 +- R/testing.R | 4 +- docker/Dockerfile | 2 +- docker/schema/create_schema | 2 +- inst/create_orderly_demo.sh | 4 +- inst/examples/demo/README.md | 2 +- inst/examples/demo/before.R | 4 +- inst/examples/demo/source.R | 2 +- .../examples/demo/src/use_dependency/script.R | 2 +- .../demo/src/use_dependency_2/script.R | 2 +- inst/init/README.md | 2 +- inst/run_orderly_demo | 2 +- inst/script | 2 +- man-roxygen/example-orderly-remote.R | 8 +-- man-roxygen/example-remote.R | 24 +++---- man/orderly_batch.Rd | 4 +- man/orderly_bundle_pack.Rd | 14 ++-- man/orderly_cleanup.Rd | 18 +++--- man/orderly_commit.Rd | 10 +-- man/orderly_config.Rd | 4 +- man/orderly_db.Rd | 10 +-- man/orderly_deduplicate.Rd | 8 +-- man/orderly_default_remote.Rd | 22 +++---- man/orderly_develop_start.Rd | 12 ++-- man/orderly_example.Rd | 4 +- man/orderly_graph.Rd | 20 +++--- man/orderly_info.Rd | 6 +- man/orderly_init.Rd | 2 +- man/orderly_latest.Rd | 16 ++--- man/orderly_list.Rd | 4 +- man/orderly_list_drafts.Rd | 18 +++--- man/orderly_list_metadata.Rd | 6 +- man/orderly_log.Rd | 16 ++--- man/orderly_migrate.Rd | 4 +- man/orderly_new.Rd | 4 +- man/orderly_packages.Rd | 4 +- man/orderly_pull_dependencies.Rd | 24 +++---- man/orderly_rebuild.Rd | 14 ++-- man/orderly_remote.Rd | 8 +-- man/orderly_remote_path.Rd | 24 +++---- man/orderly_run.Rd | 10 +-- man/orderly_run_info.Rd | 8 +-- man/orderly_run_remote.Rd | 8 +-- man/orderly_search.Rd | 20 +++--- man/orderly_test_start.Rd | 10 +-- man/orderly_use.Rd | 6 +- tests/testthat/create-testing.R | 2 +- .../examples/depends/src/depend/script.R | 2 +- .../examples/depends/src/depend2/script.R | 2 +- .../examples/depends/src/depend3/script.R | 2 +- tests/testthat/helper-orderly.R | 2 +- tests/testthat/test-bundle.R | 10 +-- tests/testthat/test-changelog.R | 2 +- tests/testthat/test-config.R | 18 +++--- tests/testthat/test-db.R | 2 +- tests/testthat/test-migrate.R | 4 +- tests/testthat/test-orderly.R | 2 +- tests/testthat/test-remote.R | 14 ++-- tests/testthat/test-slack.R | 10 +-- vignettes/bundles.Rmd | 18 +++--- vignettes/changelog.Rmd | 2 +- vignettes/orderly.Rmd | 64 +++++++++---------- vignettes/patterns.Rmd | 24 +++---- vignettes/remote.Rmd | 6 +- 86 files changed, 484 insertions(+), 484 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index f238d9d1f..92f26d828 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ -Package: orderly +Package: orderly1 Title: Lightweight Reproducible Reporting -Version: 1.6.1 +Version: 1.7.0 Description: Order, create and store reports from R. By defining a lightweight interface around the inputs and outputs of an analysis, a lot of the repetitive work for reproducible research diff --git a/R/batch.R b/R/batch.R index 4aa194302..ab0b2d5a7 100644 --- a/R/batch.R +++ b/R/batch.R @@ -3,7 +3,7 @@ ##' Run one report multiple times with different sets of parameters. ##' ##' @param name Name of the report to run (see -##' [orderly::orderly_list()]). A leading `src/` will be +##' [orderly1::orderly_list()]). A leading `src/` will be ##' removed if provided, allowing easier use of autocomplete. ##' Alternatively, the default of `NULL` is useful if you have ##' already set the working directory to be the source directory. @@ -17,18 +17,18 @@ ##' during preparation e.g. because of missing parameters this will ##' error and stop all subsequent parameter sets. ##' -##' @param ... Additional args passed to [orderly::orderly_run()] +##' @param ... Additional args passed to [orderly1::orderly_run()] ##' -##' @seealso [orderly::orderly_run()] for details of report running +##' @seealso [orderly1::orderly_run()] for details of report running ##' ##' @export ##' @return List of ids of newly created reports ##' ##' @examples ##' -##' path <- orderly::orderly_example("demo") +##' path <- orderly1::orderly_example("demo") ##' params <- data.frame(nmin = c(0.2, 0.25)) -##' ids <- orderly::orderly_batch("other", params, root = path) +##' ids <- orderly1::orderly_batch("other", params, root = path) orderly_batch <- function(name = NULL, parameters = NULL, continue_on_error = TRUE, ...) { if (NROW(parameters) < 1) { diff --git a/R/bundle.R b/R/bundle.R index 5ef25e2f4..2fb142f00 100644 --- a/R/bundle.R +++ b/R/bundle.R @@ -24,7 +24,7 @@ ##' `orderly_bundle_pack` or `orderly_bundle_run`) ##' ##' @param name Name of the report to pack (see -##' [orderly::orderly_list()]. A leading `src/` will be removed if +##' [orderly1::orderly_list()]. A leading `src/` will be removed if ##' provided, allowing easier use of autocomplete. ##' ##' @inheritParams orderly_run @@ -39,35 +39,35 @@ ##' ##' @export ##' @examples -##' path <- orderly::orderly_example("minimal") +##' path <- orderly1::orderly_example("minimal") ##' ##' # A working directory to export bundles to: ##' workdir <- tempfile() ##' ##' # Pack up the "example" report to go: -##' res <- orderly::orderly_bundle_pack(workdir, "example", root = path) +##' res <- orderly1::orderly_bundle_pack(workdir, "example", root = path) ##' ##' # The return value is a list with the id and the path to the zip ##' # file created: ##' res ##' ##' # A list of reports bundled in this directory and their status -##' orderly::orderly_bundle_list(workdir) +##' orderly1::orderly_bundle_list(workdir) ##' ##' # Run the bundle (this would ordinarily be done on another computer) -##' zip <- orderly::orderly_bundle_run(res$path, workdir) +##' zip <- orderly1::orderly_bundle_run(res$path, workdir) ##' zip ##' ##' # The status has now been updated to reflect the status -##' orderly::orderly_bundle_list(workdir) +##' orderly1::orderly_bundle_list(workdir) ##' ##' # We can import this into the orderly tree -##' orderly::orderly_bundle_import(zip$path, root = path) +##' orderly1::orderly_bundle_import(zip$path, root = path) ##' ##' # This has now been included in your orderly archive and the ##' # workdir can be safely deleted ##' unlink(workdir, recursive = TRUE) -##' orderly::orderly_list_archive(path) +##' orderly1::orderly_list_archive(path) orderly_bundle_pack <- function(path, name, parameters = NULL, envir = NULL, root = NULL, locate = TRUE, message = NULL, instance = NULL, diff --git a/R/cleanup.R b/R/cleanup.R index c6b1b79af..175d30f7b 100644 --- a/R/cleanup.R +++ b/R/cleanup.R @@ -2,7 +2,7 @@ ##' (possibly just for a set of report names) and then deletes ##' dangling data sets that are not pointed to by any draft or ##' committed reports. Running cleanup does not affect any reports -##' that have been committed with [orderly::orderly_commit()] (i.e., +##' that have been committed with [orderly1::orderly_commit()] (i.e., ##' the contents of the `archive/` directory). ##' ##' @title Orderly cleanup @@ -15,28 +15,28 @@ ##' ##' @param failed_only Delete only failed reports (those without the ##' end-of-run metadata). This will also clean up drafts created by -##' [orderly::orderly_test_start()] +##' [orderly1::orderly_test_start()] ##' @inheritParams orderly_list ##' @return No return value, this function is called only for its side effects ##' @export ##' @examples ##' # In a new example orderly, run two reports and commit only the ##' # second one: -##' path <- orderly::orderly_example("minimal") -##' id1 <- orderly::orderly_run("example", root = path) -##' id2 <- orderly::orderly_run("example", root = path) -##' orderly::orderly_commit(id2, root = path) +##' path <- orderly1::orderly_example("minimal") +##' id1 <- orderly1::orderly_run("example", root = path) +##' id2 <- orderly1::orderly_run("example", root = path) +##' orderly1::orderly_commit(id2, root = path) ##' ##' # We now have one draft and one archive report: -##' orderly::orderly_list_drafts(root = path) -##' orderly::orderly_list_archive(root = path) +##' orderly1::orderly_list_drafts(root = path) +##' orderly1::orderly_list_archive(root = path) ##' ##' # To clean up the drafts: -##' orderly::orderly_cleanup(root = path) +##' orderly1::orderly_cleanup(root = path) ##' ##' # We now have no draft and one archive reports: -##' orderly::orderly_list_drafts(root = path) -##' orderly::orderly_list_archive(root = path) +##' orderly1::orderly_list_drafts(root = path) +##' orderly1::orderly_list_archive(root = path) orderly_cleanup <- function(name = NULL, root = NULL, locate = TRUE, draft = TRUE, data = TRUE, failed_only = FALSE) { config <- orderly_config(root, locate) diff --git a/R/config.R b/R/config.R index 0ce716567..46c08cf53 100644 --- a/R/config.R +++ b/R/config.R @@ -7,9 +7,9 @@ ##' ##' @examples ##' # The orderly demo, with lots of potential reports: -##' path <- orderly::orderly_example("demo") +##' path <- orderly1::orderly_example("demo") ##' -##' orderly::orderly_config(path) +##' orderly1::orderly_config(path) orderly_config <- function(root = NULL, locate = TRUE) { if (inherits(root, "orderly_config")) { root diff --git a/R/db.R b/R/db.R index 57c285bb6..cbffd799c 100644 --- a/R/db.R +++ b/R/db.R @@ -38,13 +38,13 @@ ##' @export ##' @examples ##' # Create an orderly that has a single commited report: -##' path <- orderly::orderly_example("minimal") -##' id <- orderly::orderly_run("example", root = path) -##' orderly::orderly_commit(id, root = path) +##' path <- orderly1::orderly_example("minimal") +##' id <- orderly1::orderly_run("example", root = path) +##' orderly1::orderly_commit(id, root = path) ##' ##' # The source database holds the data that might be accessible via ##' # the 'data' entry in orderly.yml: -##' db <- orderly::orderly_db("source", root = path) +##' db <- orderly1::orderly_db("source", root = path) ##' # This is a list, with one connection per database listed in the ##' # orderly_config.yml (an empty list if none are specified): ##' db @@ -54,7 +54,7 @@ ##' ##' # The destination database holds information about the archived ##' # reports: -##' db <- orderly::orderly_db("destination", root = path) +##' db <- orderly1::orderly_db("destination", root = path) ##' DBI::dbListTables(db) ##' ##' # These tables are documented online: @@ -141,11 +141,11 @@ orderly_db_args <- function(x, config, name) { ##' @export ##' @return No return value, this function is called only for its side effects ##' @examples -##' path <- orderly::orderly_example("minimal") -##' id <- orderly::orderly_run("example", root = path) -##' orderly::orderly_commit(id, root = path) +##' path <- orderly1::orderly_example("minimal") +##' id <- orderly1::orderly_run("example", root = path) +##' orderly1::orderly_commit(id, root = path) ##' -##' con <- orderly::orderly_db("destination", root = path) +##' con <- orderly1::orderly_db("destination", root = path) ##' DBI::dbReadTable(con, "report_version") ##' DBI::dbDisconnect(con) ##' @@ -154,15 +154,15 @@ orderly_db_args <- function(x, config, name) { ##' # your own fields - only the fields that orderly looks after can ##' # be recovered!) ##' file.remove(file.path(path, "orderly.sqlite")) -##' orderly::orderly_rebuild(path) +##' orderly1::orderly_rebuild(path) ##' file.exists(file.path(path, "orderly.sqlite")) -##' con <- orderly::orderly_db("destination", root = path) +##' con <- orderly1::orderly_db("destination", root = path) ##' DBI::dbReadTable(con, "report_version") ##' DBI::dbDisconnect(con) ##' ##' # It is safe to rebuild a database repeatedly, though this can be ##' # slow with larger databases. -##' orderly::orderly_rebuild(path) +##' orderly1::orderly_rebuild(path) orderly_rebuild <- function(root = NULL, locate = TRUE, verbose = TRUE, if_schema_changed = FALSE) { ## We'll skip warnings here - they'll come out as messages rather diff --git a/R/db2.R b/R/db2.R index cb8b4d5a0..508aea7ce 100644 --- a/R/db2.R +++ b/R/db2.R @@ -151,7 +151,7 @@ report_db_open_existing <- function(con, config) { version_db <- DBI::dbReadTable(con, orderly_schema_table)$schema_version version_package <- orderly_schema_version if (numeric_version(version_db) < numeric_version(version_package)) { - stop("orderly db needs rebuilding with orderly::orderly_rebuild()", + stop("orderly db needs rebuilding with orderly1::orderly_rebuild()", call. = FALSE) } @@ -175,7 +175,7 @@ report_db_open_existing <- function(con, config) { config$changelog$public %||% logical(0)) if (!ok) { stop( - "changelog labels have changed: rebuild with orderly::orderly_rebuild()", + "changelog labels have changed: rebuild with orderly1::orderly_rebuild()", call. = FALSE) } @@ -183,7 +183,7 @@ report_db_open_existing <- function(con, config) { ok <- setequal(tag, config$tags) if (!ok) { stop( - "tags have changed: rebuild with orderly::orderly_rebuild()", + "tags have changed: rebuild with orderly1::orderly_rebuild()", call. = FALSE) } } diff --git a/R/deduplicate.R b/R/deduplicate.R index acb478dee..470112f06 100644 --- a/R/deduplicate.R +++ b/R/deduplicate.R @@ -44,13 +44,13 @@ ##' @export ##' @examples ##' -##' path <- orderly::orderly_example("demo") -##' id1 <- orderly::orderly_run("minimal", root = path) -##' id2 <- orderly::orderly_run("minimal", root = path) +##' path <- orderly1::orderly_example("demo") +##' id1 <- orderly1::orderly_run("minimal", root = path) +##' id2 <- orderly1::orderly_run("minimal", root = path) ##' orderly_commit(id1, root = path) ##' orderly_commit(id2, root = path) ##' tryCatch( -##' orderly::orderly_deduplicate(path, dry_run = TRUE), +##' orderly1::orderly_deduplicate(path, dry_run = TRUE), ##' error = function(e) NULL) orderly_deduplicate <- function(root = NULL, locate = TRUE, dry_run = TRUE, quiet = FALSE) { diff --git a/R/dependencies.R b/R/dependencies.R index 562b1c58c..db0431fb5 100644 --- a/R/dependencies.R +++ b/R/dependencies.R @@ -25,8 +25,8 @@ ##' @section Remark: ##' ##' By default the tree is built using data from the local report -##' database (see [orderly::orderly_commit], -##' [orderly::orderly_db]). This means that it will not find changes +##' database (see [orderly1::orderly_commit], +##' [orderly1::orderly_db]). This means that it will not find changes ##' from a report that has not be run and committed. That is, if a ##' user changes a report to use or create different artefacts this ##' will not be picked up by the function until the reports are @@ -77,16 +77,16 @@ ##' report. ##' @export ##' @examples -##' path <- orderly::orderly_example("demo") -##' -##' id <- orderly::orderly_run("other", root = path, parameters=list(nmin=0)) -##' orderly::orderly_commit(id, root = path) -##' id <- orderly::orderly_run("use_dependency", root = path) -##' orderly::orderly_commit(id, root = path) -##' id <- orderly::orderly_run("use_dependency_2", root = path) -##' orderly::orderly_commit(id, root = path) -##' orderly::orderly_graph("other", root = path) -##' orderly::orderly_graph("use_dependency_2", root = path, +##' path <- orderly1::orderly_example("demo") +##' +##' id <- orderly1::orderly_run("other", root = path, parameters=list(nmin=0)) +##' orderly1::orderly_commit(id, root = path) +##' id <- orderly1::orderly_run("use_dependency", root = path) +##' orderly1::orderly_commit(id, root = path) +##' id <- orderly1::orderly_run("use_dependency_2", root = path) +##' orderly1::orderly_commit(id, root = path) +##' orderly1::orderly_graph("other", root = path) +##' orderly1::orderly_graph("use_dependency_2", root = path, ##' direction = "upstream") orderly_graph <- function(name, id = "latest", root = NULL, locate = TRUE, direction = "downstream", propagate = TRUE, diff --git a/R/develop.R b/R/develop.R index d8ccf1b53..de2217d85 100644 --- a/R/develop.R +++ b/R/develop.R @@ -37,7 +37,7 @@ ##' happen. When in doubt, restart your R session. ##' ##' Note that these functions are much more permissive as to the state -##' of your `orderly.yml` than [orderly::orderly_run()] - in +##' of your `orderly.yml` than [orderly1::orderly_run()] - in ##' particular, they will run, with a message, even if you have not ##' yet defined a `script:` or any `artefacts:`. ##' @@ -47,7 +47,7 @@ ##' @title Develop an orderly report ##' ##' @param name Name of the report to develop (see -##' [orderly::orderly_list()]). A leading `src/` will be +##' [orderly1::orderly_list()]). A leading `src/` will be ##' removed if provided, allowing easier use of autocomplete. ##' Alternatively, the default of `NULL` is useful if you have ##' already set the working directory to be the source directory. @@ -59,23 +59,23 @@ ##' ##' @export ##' @examples -##' path <- orderly::orderly_example("demo") +##' path <- orderly1::orderly_example("demo") ##' ##' # This report uses a dependency - it requires that the file ##' # incoming.csv exists. This file is created from the report 'other' -##' orderly::orderly_develop_status("use_dependency", root = path) +##' orderly1::orderly_develop_status("use_dependency", root = path) ##' ##' # Copy the required dependencies over, in this case from a draft report -##' orderly::orderly_run("other", list(nmin = 0), root = path, echo = FALSE) -##' orderly::orderly_develop_start("use_dependency", root = path, +##' orderly1::orderly_run("other", list(nmin = 0), root = path, echo = FALSE) +##' orderly1::orderly_develop_start("use_dependency", root = path, ##' use_draft = TRUE) ##' ##' # Files have been copied across into the source directory -##' orderly::orderly_develop_status("use_dependency", root = path) +##' orderly1::orderly_develop_status("use_dependency", root = path) ##' ##' # The report can then be developed as needed, interactively. After ##' # we're happy things can be cleaned up with -##' orderly::orderly_develop_clean("use_dependency", root = path) +##' orderly1::orderly_develop_clean("use_dependency", root = path) ##' orderly_develop_start <- function(name = NULL, parameters = NULL, envir = parent.frame(), diff --git a/R/helpers.R b/R/helpers.R index 118f61680..668c8a65e 100644 --- a/R/helpers.R +++ b/R/helpers.R @@ -14,7 +14,7 @@ ##' orderly.yml ##' ##' @param name Name of the report to modify. Like -##' [orderly::orderly_develop_start()] this can be `NULL` if +##' [orderly1::orderly_develop_start()] this can be `NULL` if ##' you have already set the working directory to be the source ##' directory. ##' @@ -37,7 +37,7 @@ ##' @export ##' @rdname orderly_use ##' @examples -##' path <- orderly::orderly_example("minimal") +##' path <- orderly1::orderly_example("minimal") ##' ##' # Suppose we wanted to use the mtcars data within our report. ##' # First, the file must exist: @@ -45,10 +45,10 @@ ##' row.names = FALSE) ##' ##' # Preview expected changes -##' orderly::orderly_use_resource("mtcars.csv", "example", path, edit = FALSE) +##' orderly1::orderly_use_resource("mtcars.csv", "example", path, edit = FALSE) ##' ##' # Modify the orderly.yml file within src/example: -##' orderly::orderly_use_resource("mtcars.csv", "example", path, prompt = FALSE) +##' orderly1::orderly_use_resource("mtcars.csv", "example", path, prompt = FALSE) ##' ##' # The result is a file that now has a 'resources' section ##' # containing our new file diff --git a/R/info.R b/R/info.R index e9cf693fd..c9de27f54 100644 --- a/R/info.R +++ b/R/info.R @@ -15,9 +15,9 @@ ##' @export ##' ##' @examples -##' path <- orderly::orderly_example("demo") -##' id <- orderly::orderly_run("minimal", root = path) -##' orderly::orderly_info(id, "minimal", root = path) +##' path <- orderly1::orderly_example("demo") +##' id <- orderly1::orderly_run("minimal", root = path) +##' orderly1::orderly_info(id, "minimal", root = path) orderly_info <- function(id, name, root = NULL, locate = TRUE) { report <- orderly_find_report(id, name, root, locate, draft = "newer", must_work = TRUE) @@ -80,8 +80,8 @@ orderly_info <- function(id, name, root = NULL, locate = TRUE) { ##' @export ##' ##' @examples -##' path <- orderly::orderly_example("minimal") -##' orderly::orderly_packages(root = path) +##' path <- orderly1::orderly_example("minimal") +##' orderly1::orderly_packages(root = path) orderly_packages <- function(root = NULL, locate = TRUE) { cfg <- orderly_config(root, locate) names <- basename(list_dirs(path_src(cfg$root))) diff --git a/R/init.R b/R/init.R index d17c06c43..d1bee73ea 100644 --- a/R/init.R +++ b/R/init.R @@ -12,16 +12,16 @@ ##' * `src`: The path where report sources live. This should be placed ##' under version control, and contain a number of reports, each in ##' their own directory with an `orderly.yml` describing their -##' inputs and outputs (artefacts). The [orderly::orderly_new()] +##' inputs and outputs (artefacts). The [orderly1::orderly_new()] ##' function can be used to accelerate creation of new reports. ##' ##' * `draft`: A directory where reports will be run using -##' [orderly::orderly_run()]. This directory should be excluded +##' [orderly1::orderly_run()]. This directory should be excluded ##' from version control. `orderly` will create it as needed if ##' it does not exist when a report is run. ##' ##' * `archive`: A directory where successfully run reports will be -##' moved to after being committed with [orderly::orderly_commit()]. +##' moved to after being committed with [orderly1::orderly_commit()]. ##' This directory should be excluded from version ##' control. `orderly` will create it as needed if it does not ##' exist when a report is committed. @@ -45,14 +45,14 @@ ##' ##' @export ##' -##' @seealso [orderly::orderly_new()] for creating new reports within +##' @seealso [orderly1::orderly_new()] for creating new reports within ##' a configured orderly repository. ##' ##' @return The path to the newly created archive ##' ##' @examples ##' # Initialise a new orderly repository in an temporary directory: -##' path <- orderly::orderly_init(tempfile()) +##' path <- orderly1::orderly_init(tempfile()) ##' ##' # This has created the directory skeleton that you need to get ##' # started using orderly: diff --git a/R/logging.R b/R/logging.R index 6a0a42930..b500c498c 100644 --- a/R/logging.R +++ b/R/logging.R @@ -21,33 +21,33 @@ ##' This allows patterns like: ##' ##' ``` -##' if (!orderly::orderly_log_off()) { -##' on.exit(orderly::orderly_log_on()) +##' if (!orderly1::orderly_log_off()) { +##' on.exit(orderly1::orderly_log_on()) ##' } ##' ``` ##' ##' to disable logging within a function (the `on.exit` block ##' will be run when the function exits). ##' -##' @seealso [orderly::orderly_run()], which makes use of these log +##' @seealso [orderly1::orderly_run()], which makes use of these log ##' messages ##' ##' @examples ##' # We are going to log things below -##' logging_was_enabled <- orderly::orderly_log_on() +##' logging_was_enabled <- orderly1::orderly_log_on() ##' ##' # About orderly log messages: ##' # Orderly log messages have the form "[title] message" -##' orderly::orderly_log_on() -##' orderly::orderly_log("title", "message") +##' orderly1::orderly_log_on() +##' orderly1::orderly_log("title", "message") ##' ##' # If logging is disabled they are not printed: -##' orderly::orderly_log_off() -##' orderly::orderly_log("title", "message") +##' orderly1::orderly_log_off() +##' orderly1::orderly_log("title", "message") ##' ##' # Restore to previous settings: ##' if (logging_was_enabled) { -##' orderly::orderly_log_on() +##' orderly1::orderly_log_on() ##' } orderly_log_on <- function() { invisible(!isTRUE(options(orderly.nolog = NULL)$orderly.nolog)) diff --git a/R/migrate.R b/R/migrate.R index 8c1bebc72..0bec69155 100644 --- a/R/migrate.R +++ b/R/migrate.R @@ -39,8 +39,8 @@ ##' @examples ##' # Without an orderly repository created by a previous version of ##' # orderly, this function does nothing interesting: -##' path <- orderly::orderly_example("minimal") -##' orderly::orderly_migrate(path) +##' path <- orderly1::orderly_example("minimal") +##' orderly1::orderly_migrate(path) orderly_migrate <- function(root = NULL, locate = TRUE, to = NULL, dry_run = FALSE, skip_failed = FALSE, clean = FALSE) { @@ -225,7 +225,7 @@ check_orderly_archive_version <- function(config) { } else if (used < curr) { stop(sprintf("orderly archive needs migrating from %s => %s\n", as.character(used), as.character(curr)), - "Run orderly::orderly_migrate() to fix", + "Run orderly1::orderly_migrate() to fix", call. = FALSE) } config diff --git a/R/new.R b/R/new.R index 7c08ab30f..b7b6fb217 100644 --- a/R/new.R +++ b/R/new.R @@ -35,17 +35,17 @@ ##' ##' @inheritParams orderly_list ##' -##' @seealso [orderly::orderly_init()] for initialising a new orderly +##' @seealso [orderly1::orderly_init()] for initialising a new orderly ##' repository. ##' ##' @export ##' @return The path of the new source directory, invisibly ##' @examples -##' path <- orderly::orderly_example("minimal") +##' path <- orderly1::orderly_example("minimal") ##' ##' # Create a new report with the name "myreport" in this orderly ##' # repository: -##' orderly::orderly_new("myreport", root = path) +##' orderly1::orderly_new("myreport", root = path) ##' ##' # The directory will be initialised with a orderly.yml file ##' # containing documentation diff --git a/R/query.R b/R/query.R index 8c6a38320..ef3f25d05 100644 --- a/R/query.R +++ b/R/query.R @@ -22,25 +22,25 @@ version_id_re <- "^([0-9]{8}-[0-9]{6})-([[:xdigit:]]{4})([[:xdigit:]]{4})$" ##' then orderly looks in the working directory and up through its ##' parents until it finds an `orderly_config.yml` file. ##' -##' @seealso [orderly::orderly_list_archive()] and -##' [orderly::orderly_list_drafts()], which list archived +##' @seealso [orderly1::orderly_list_archive()] and +##' [orderly1::orderly_list_drafts()], which list archived ##' (committed) and draft reports and their versions. ##' ##' @export ##' @return A character vector of report names ##' @examples ##' # The orderly demo, with lots of potential reports: -##' path <- orderly::orderly_example("demo") +##' path <- orderly1::orderly_example("demo") ##' ##' # Reports that _could_ be run: -##' orderly::orderly_list(path) +##' orderly1::orderly_list(path) orderly_list <- function(root = NULL, locate = TRUE) { config <- orderly_config(root, locate) basename(list_dirs(path_src(config$root))) } ##' List draft and archived reports. This returns a data.frame with -##' columns `name` (see [orderly::orderly_list()]) and `id`. +##' columns `name` (see [orderly1::orderly_list()]) and `id`. ##' ##' @title List draft and archived reports ##' @@ -51,8 +51,8 @@ orderly_list <- function(root = NULL, locate = TRUE) { ##' no failed run should make it into the archive). A failed report ##' is one that lacks an `orderly_run.rds` file. ##' -##' @seealso [orderly::orderly_list()], which lists the names of -##' source reports that can be run, and [orderly::orderly_latest()] +##' @seealso [orderly1::orderly_list()], which lists the names of +##' source reports that can be run, and [orderly1::orderly_latest()] ##' which returns the id of the most recent report. ##' ##' @export @@ -63,29 +63,29 @@ orderly_list <- function(root = NULL, locate = TRUE) { ##' ##' @examples ##' # The orderly demo, with lots of potential reports: -##' path <- orderly::orderly_example("demo") +##' path <- orderly1::orderly_example("demo") ##' ##' # Reports that _could_ be run: -##' orderly::orderly_list(path) +##' orderly1::orderly_list(path) ##' ##' # Run a report twice: -##' id1 <- orderly::orderly_run("minimal", root = path) -##' id2 <- orderly::orderly_run("minimal", root = path) +##' id1 <- orderly1::orderly_run("minimal", root = path) +##' id2 <- orderly1::orderly_run("minimal", root = path) ##' ##' # We can see both drafts: -##' orderly::orderly_list_drafts(path) +##' orderly1::orderly_list_drafts(path) ##' ##' # Nothing is in the archive: -##' orderly::orderly_list_archive(path) +##' orderly1::orderly_list_archive(path) ##' ##' # Commit a report: -##' orderly::orderly_commit(id2, root = path) +##' orderly1::orderly_commit(id2, root = path) ##' ##' # Only one draft now -##' orderly::orderly_list_drafts(path) +##' orderly1::orderly_list_drafts(path) ##' ##' # And the second report is in the archive: -##' orderly::orderly_list_archive(path) +##' orderly1::orderly_list_archive(path) orderly_list_drafts <- function(root = NULL, locate = TRUE, include_failed = FALSE) { orderly_list2(TRUE, root, locate, include_failed) @@ -99,7 +99,7 @@ orderly_list_archive <- function(root = NULL, locate = TRUE) { ##' List reports that are present only as metadata; these are the -##' result of doing [orderly::orderly_pull_archive()] with +##' result of doing [orderly1::orderly_pull_archive()] with ##' `recursive = FALSE`, in which case only metadata was ##' downloaded and not the report contents itself. ##' @@ -111,14 +111,14 @@ orderly_list_archive <- function(root = NULL, locate = TRUE) { ##' reports that are also included in the archive. ##' ##' @return A [data.frame()] with columns `name` and -##' `id`, as for [orderly::orderly_list_archive()] +##' `id`, as for [orderly1::orderly_list_archive()] ##' ##' @export ##' @examples -##' path <- orderly::orderly_example("minimal") +##' path <- orderly1::orderly_example("minimal") ##' # No metadata-only reports will be present, unless you have run -##' # orderly::orderly_pull_archive(..., recursive = FALSE) -##' orderly::orderly_list_metadata(path) +##' # orderly1::orderly_pull_archive(..., recursive = FALSE) +##' orderly1::orderly_list_metadata(path) orderly_list_metadata <- function(root = NULL, locate = FALSE, include_archive = FALSE) { config <- orderly_config(root, locate) @@ -154,28 +154,28 @@ orderly_list_metadata <- function(root = NULL, locate = FALSE, ##' ##' @inheritParams orderly_list ##' -##' @seealso [orderly::orderly_list] and -##' [orderly::orderly_list_archive] for listing report names and +##' @seealso [orderly1::orderly_list] and +##' [orderly1::orderly_list_archive] for listing report names and ##' versions. ##' ##' @return A character string with the id of the most recent report ##' ##' @export ##' @examples -##' path <- orderly::orderly_example("minimal") -##' id1 <- orderly::orderly_run("example", root = path, echo = FALSE) -##' id2 <- orderly::orderly_run("example", root = path, echo = FALSE) +##' path <- orderly1::orderly_example("minimal") +##' id1 <- orderly1::orderly_run("example", root = path, echo = FALSE) +##' id2 <- orderly1::orderly_run("example", root = path, echo = FALSE) ##' ##' # With no reports committed there is no latest report: -##' orderly::orderly_latest("example", root = path, must_work = FALSE) +##' orderly1::orderly_latest("example", root = path, must_work = FALSE) ##' ##' # Commit the first report and it will be reported as latest: -##' orderly::orderly_commit(id1, root = path) -##' orderly::orderly_latest("example", root = path) +##' orderly1::orderly_commit(id1, root = path) +##' orderly1::orderly_latest("example", root = path) ##' ##' # Commit the second report and it will be reported as latest instead: -##' orderly::orderly_commit(id2, root = path) -##' orderly::orderly_latest("example", root = path) +##' orderly1::orderly_commit(id2, root = path) +##' orderly1::orderly_latest("example", root = path) orderly_latest <- function(name = NULL, root = NULL, locate = TRUE, draft = FALSE, must_work = TRUE) { config <- orderly_config(root, locate) diff --git a/R/query_search.R b/R/query_search.R index 37cc0132f..de02094a4 100644 --- a/R/query_search.R +++ b/R/query_search.R @@ -74,7 +74,7 @@ ##' to `TRUE` and `FALSE`, respectively. ##' ##' @param parameters Named list of parameters (as would be passed to -##' [orderly::orderly_run()]) if your query uses parameters on the +##' [orderly1::orderly_run()]) if your query uses parameters on the ##' right-hand-side of an expression. ##' ##' @param remote A remote to use, if you want to apply the query @@ -98,7 +98,7 @@ ##' # "dataset" and "plot" - the "dataset" tag will always be applied ##' # as it is listed in the orderly.yml but we can still add the ##' # "plot" tag interactively -##' root <- orderly::orderly_example("demo") +##' root <- orderly1::orderly_example("demo") ##' ##' # A helper function to mass-produce reports will reduce noise a bit ##' run1 <- function(nmin, tags = NULL) { @@ -112,38 +112,38 @@ ##' ##' # We can then ask for all reports where the parameter nmin was more ##' # than some value -##' orderly::orderly_search("parameter:nmin > 0.15", "other", root = root) +##' orderly1::orderly_search("parameter:nmin > 0.15", "other", root = root) ##' ##' # Or use "&&" to find tags within a range -##' orderly::orderly_search("parameter:nmin > 0.1 && parameter:nmin < 0.3", +##' orderly1::orderly_search("parameter:nmin > 0.1 && parameter:nmin < 0.3", ##' "other", root = root) ##' ##' # If a parameter is not present in some versions of a report you ##' # can use is.null to test for it (this is only ever the case if ##' # you have altered a report definition to add or remove a ##' # parameter) -##' orderly::orderly_search("is.null(parameter:nmin)", "other", root = root) +##' orderly1::orderly_search("is.null(parameter:nmin)", "other", root = root) ##' ##' # We can look for tags -##' orderly::orderly_search("tag:plot", "other", root = root) +##' orderly1::orderly_search("tag:plot", "other", root = root) ##' ##' # or exclude them -##' orderly::orderly_search("!tag:plot", "other", root = root) +##' orderly1::orderly_search("!tag:plot", "other", root = root) ##' ##' # or combine that with the presence/absence of a tag -##' orderly::orderly_search("parameter:nmin > 0.15 && !tag:plot", +##' orderly1::orderly_search("parameter:nmin > 0.15 && !tag:plot", ##' "other", root = root) ##' ##' # Use latest() over a query to find the latest report matching the ##' # query expression. -##' orderly::orderly_search("latest(parameter:nmin > 0.15)", +##' orderly1::orderly_search("latest(parameter:nmin > 0.15)", ##' "other", root = root) ##' ##' # If no reports are found, then a zero-length character vector is returned -##' orderly::orderly_search("parameter:nmin > 0.4", "other", root = root) +##' orderly1::orderly_search("parameter:nmin > 0.4", "other", root = root) ##' ##' # Or, in the case of latest(), NA -##' orderly::orderly_search("latest(parameter:nmin > 0.4)", +##' orderly1::orderly_search("latest(parameter:nmin > 0.4)", ##' "other", root = root) orderly_search <- function(query, name, parameters = NULL, draft = FALSE, root = NULL, locate = TRUE, remote = NULL) { diff --git a/R/recipe_commit.R b/R/recipe_commit.R index 378611625..fac2e90cb 100644 --- a/R/recipe_commit.R +++ b/R/recipe_commit.R @@ -20,16 +20,16 @@ ##' @export ##' @examples ##' # In a new example orderly, run a report -##' path <- orderly::orderly_example("minimal") -##' id <- orderly::orderly_run("example", root = path) +##' path <- orderly1::orderly_example("minimal") +##' id <- orderly1::orderly_run("example", root = path) ##' ##' # To commit it, all we need is the report id -##' orderly::orderly_commit(id, root = path) +##' orderly1::orderly_commit(id, root = path) ##' ##' # The report is now committed, and as such could be used as a ##' # dependency in another report and is not subject to deletion by -##' # orderly::orderly_cleanup -##' orderly::orderly_list_archive(root = path) +##' # orderly1::orderly_cleanup +##' orderly1::orderly_list_archive(root = path) orderly_commit <- function(id, name = NULL, root = NULL, locate = TRUE, timeout = 10) { config <- orderly_config(root, locate) diff --git a/R/recipe_run.R b/R/recipe_run.R index 7fb593954..0a33c9426 100644 --- a/R/recipe_run.R +++ b/R/recipe_run.R @@ -2,13 +2,13 @@ ##' `drafts/`, copy your declared resources there, ##' extract data from databases (if you are using them), run your ##' script and check that all expected artefacts were created. Once -##' successfully run you can use [orderly::orderly_commit()] to move +##' successfully run you can use [orderly1::orderly_commit()] to move ##' it to the `archive` directory. ##' ##' Parameters are passed to the report as a named list, for example ##' ##' ``` -##' id <- orderly::orderly_run("other", list(nmin = 0.2), root = path) +##' id <- orderly1::orderly_run("other", list(nmin = 0.2), root = path) ##' ``` ##' ##' (see the examples). The names of the parameters (here, @@ -26,7 +26,7 @@ ##' @title Run a report ##' ##' @param name Name of the report to run (see -##' [orderly::orderly_list()]). A leading `src/` will be +##' [orderly1::orderly_list()]). A leading `src/` will be ##' removed if provided, allowing easier use of autocomplete. ##' Alternatively, the default of `NULL` is useful if you have ##' already set the working directory to be the source directory. @@ -67,7 +67,7 @@ ##' order to run a report with the same dependencies as are ##' available on a remote server, particularly when using `id = ##' "latest"`. Note that this is not the same as running -##' [orderly::orderly_pull_dependencies()], then `orderly_run` +##' [orderly1::orderly_pull_dependencies()], then `orderly_run` ##' with `remote = NULL`, as the pull/run approach will use the ##' latest report in *your* archive but the `remote = ##' "remote"` approach will use the latest approach in the @@ -79,17 +79,17 @@ ##' the `tags:` field in `orderly.yml` and must be present ##' in `orderly_config.yml`. ##' -##' @seealso [orderly::orderly_log()] for controlling display of log +##' @seealso [orderly1::orderly_log()] for controlling display of log ##' messages (not just R output) ##' ##' @export ##' @return The id of the newly created report ##' @examples -##' path <- orderly::orderly_example("demo") +##' path <- orderly1::orderly_example("demo") ##' ##' # To run most reports, provide the report name (and the path if ##' # not running in the working directory, as is the case here): -##' id <- orderly::orderly_run("minimal", root = path) +##' id <- orderly1::orderly_run("minimal", root = path) ##' ##' # Every report gets a unique identifier, based on the time (it is ##' # ISO 8601 time with random hex appended to end) @@ -97,7 +97,7 @@ ##' ##' # After being run, a report is a "draft" and will exist in the ##' # drafts directory: -##' orderly::orderly_list_drafts(root = path) +##' orderly1::orderly_list_drafts(root = path) ##' ##' # Draft reports are always stored in the path ##' # /draft//, so we have @@ -107,7 +107,7 @@ ##' ##' # If a report has parameters, then these must be passed in as a ##' # named list. -##' id <- orderly::orderly_run("other", list(nmin = 0.2), root = path) +##' id <- orderly1::orderly_run("other", list(nmin = 0.2), root = path) ##' ##' # These parameters can be used in SQL queries or in the report ##' # code. @@ -338,7 +338,7 @@ recipe_current_run_clear <- function() { ##' during an orderly run. The format returned is internal to orderly ##' and subject to change. It is designed to be used within report ##' code. To use in conjunction with -##' [orderly::orderly_test_start()], you must pass in the path to the +##' [orderly1::orderly_test_start()], you must pass in the path to the ##' report in question. ##' ##' @section Warning: @@ -350,23 +350,23 @@ recipe_current_run_clear <- function() { ##' @param path Path to the report currently being run. This should ##' be left as `NULL` when running a report, and the path to ##' the report being run should be used when using -##' [orderly::orderly_test_start()] +##' [orderly1::orderly_test_start()] ##' ##' @export ##' @return A list of metadata about the current report ##' @examples -##' path <- orderly::orderly_example("demo") +##' path <- orderly1::orderly_example("demo") ##' ##' # This example uses orderly_run_info within its script, saving the ##' # output to "output.rds" ##' readLines(file.path(path, "src", "use_dependency", "script.R")) ##' ##' # Run the dependency: -##' id <- orderly::orderly_run("other", list(nmin = 0), root = path) -##' orderly::orderly_commit(id, root = path) +##' id <- orderly1::orderly_run("other", list(nmin = 0), root = path) +##' orderly1::orderly_commit(id, root = path) ##' ##' # Then the report -##' id <- orderly::orderly_run("use_dependency", root = path) +##' id <- orderly1::orderly_run("use_dependency", root = path) ##' ##' # This is the contents: ##' readRDS(file.path(path, "draft", "use_dependency", id, "info.rds")) diff --git a/R/recipe_test.R b/R/recipe_test.R index 901668e3b..5ad947d90 100644 --- a/R/recipe_test.R +++ b/R/recipe_test.R @@ -5,7 +5,7 @@ ##' the report hands back to the user. ##' ##' Previous versions of orderly changed into the created directory -##' when using `orderly::orderly_test_start`, which allowed +##' when using `orderly1::orderly_test_start`, which allowed ##' interactive testing of a report, including ensuring that it has ##' created all expected outputs. However, CRAN rules do not allow ##' changing the working directory, which significantly reduces the @@ -25,7 +25,7 @@ ##' @title Prepare a directory for orderly to use ##' ##' @param name Name of the report to run (see -##' [orderly::orderly_list()]). A leading `src/` will be +##' [orderly1::orderly_list()]). A leading `src/` will be ##' removed if provided, allowing easier use of autocomplete. ##' ##' @inheritParams orderly_run @@ -33,14 +33,14 @@ ##' @export ##' @examples ##' -##' path <- orderly::orderly_example("minimal") -##' p <- orderly::orderly_test_start("example", root = path) +##' path <- orderly1::orderly_example("minimal") +##' p <- orderly1::orderly_test_start("example", root = path) ##' ##' # The data in the orderly example is now available to use ##' dat ##' ##' # Check to see which artefacts have been created so far: -##' orderly::orderly_test_check(p) +##' orderly1::orderly_test_check(p) ##' ##' # Manually the code that this report has in its script ##' png(file.path(p, "mygraph.png")) @@ -48,7 +48,7 @@ ##' dev.off() ##' ##' # We now confirm that the artefact has been created: -##' orderly::orderly_test_check(p) +##' orderly1::orderly_test_check(p) orderly_test_start <- function(name, parameters = NULL, envir = parent.frame(), root = NULL, locate = TRUE, instance = NULL, use_draft = FALSE, remote = NULL) { @@ -71,7 +71,7 @@ orderly_test_start <- function(name, parameters = NULL, envir = parent.frame(), "", sprintf(' setwd("%s")', clean_path(getwd())), "", - "Please see the documentation ?orderly::orderly_test_start for", + "Please see the documentation ?orderly1::orderly_test_start for", "more details") message(paste(msg, collapse = "\n")) diff --git a/R/remote.R b/R/remote.R index fccf25fdf..b6313bb34 100644 --- a/R/remote.R +++ b/R/remote.R @@ -17,7 +17,7 @@ ##' Pulling an archive report from a remote also pulls its ##' dependencies (recursively), and adds all of these to the local ##' database. This may require migrating old orderly archives -##' ([orderly::orderly_migrate()]). Note that this migration will +##' ([orderly1::orderly_migrate()]). Note that this migration will ##' likely fail for remote orderly versions older than 0.6.8 because ##' the migration needs to read data files on disk that are not ##' included in the downloaded archive in order to collect all the @@ -26,7 +26,7 @@ ##' archive, and then re-pull. ##' ##' Pushing an archive is possible only if the remote supports it. -##' Currently this is supported by [orderly::orderly_remote_path()] +##' Currently this is supported by [orderly1::orderly_remote_path()] ##' remotes, though not by orderlyweb remotes. There is no control ##' over what will *accept* a push at this point, nor any check ##' that what you've pushed is "good" except that it exists in your @@ -44,7 +44,7 @@ ##' character string indicating a remote specified in the ##' `remotes` block of your `orderly_config.yml`. It is ##' also possible to pass in a directly created remote object (e.g., -##' using [orderly::orderly_remote_path()], or one provided by +##' using [orderly1::orderly_remote_path()], or one provided by ##' another package). If left `NULL`, then the default remote ##' for this orderly repository is used - by default that is the ##' first listed remote. @@ -69,7 +69,7 @@ ##' @return No return value, these functions are called only for their ##' side effects ##' -##' @seealso [orderly::orderly_remote_path()], which implements the +##' @seealso [orderly1::orderly_remote_path()], which implements the ##' remote interface for orderly repositories at a local path. See ##' also [OrderlyWeb](https://github.com/vimc/orderly-web) for a ##' system for hosting orderly repositories over an HTTP API. @@ -254,11 +254,11 @@ orderly_push_archive <- function(name, id = "latest", root = NULL, ##' @export ##' @return No return value, this function is called only for its side effects ##' @examples -##' path_remote <- orderly::orderly_example("demo") -##' path_local <- orderly::orderly_example("demo") -##' remote <- orderly::orderly_remote_path(path_remote) +##' path_remote <- orderly1::orderly_example("demo") +##' path_local <- orderly1::orderly_example("demo") +##' remote <- orderly1::orderly_remote_path(path_remote) ##' # Currently, path remotes don't support run -##' try(orderly::orderly_run_remote( +##' try(orderly1::orderly_run_remote( ##' "minimal", remote = remote, root = path_local)) orderly_run_remote <- function(name, parameters = NULL, ref = NULL, timeout = NULL, wait = 3600, poll = 1, @@ -302,32 +302,32 @@ orderly_run_remote <- function(name, parameters = NULL, ref = NULL, ##' @rdname orderly_default_remote ##' @examples ##' # Same setup as in orderly_remote_path, with a remote orderly: -##' path_remote <- orderly::orderly_example("demo") -##' id <- orderly::orderly_run("other", list(nmin = 0), +##' path_remote <- orderly1::orderly_example("demo") +##' id <- orderly1::orderly_run("other", list(nmin = 0), ##' root = path_remote, echo = FALSE) -##' orderly::orderly_commit(id, root = path_remote) -##' id <- orderly::orderly_run("use_dependency", +##' orderly1::orderly_commit(id, root = path_remote) +##' id <- orderly1::orderly_run("use_dependency", ##' root = path_remote, echo = FALSE) -##' orderly::orderly_commit(id, root = path_remote) +##' orderly1::orderly_commit(id, root = path_remote) ##' ##' # And a local orderly -##' path_local <- orderly::orderly_example("demo") +##' path_local <- orderly1::orderly_example("demo") ##' ##' # We'll create an object to interact with this remote using ##' # orderly_remote_path. -##' remote <- orderly::orderly_remote_path(path_remote) +##' remote <- orderly1::orderly_remote_path(path_remote) ##' ##' # There is no remote set by default: -##' try(orderly::orderly_default_remote_get(root = path_local)) +##' try(orderly1::orderly_default_remote_get(root = path_local)) ##' ##' # We can set one: -##' orderly::orderly_default_remote_set(remote, root = path_local) +##' orderly1::orderly_default_remote_set(remote, root = path_local) ##' ##' # and now we can retrieve it: -##' orderly::orderly_default_remote_get(root = path_local) +##' orderly1::orderly_default_remote_get(root = path_local) ##' ##' # Note that this has not affected the other orderly: -##' try(orderly::orderly_default_remote_get(root = path_remote)) +##' try(orderly1::orderly_default_remote_get(root = path_remote)) orderly_default_remote_set <- function(value, root = NULL, locate = TRUE) { config <- orderly_config(root, locate) @@ -353,7 +353,7 @@ orderly_default_remote_get <- function(root = NULL, locate = TRUE) { return(get_remote(names(config$remote)[[1L]], config)) } msg <- paste("default remote has not been set yet:", - "use 'orderly::orderly_default_remote_set'") + "use 'orderly1::orderly_default_remote_set'") stop(msg) } @@ -371,7 +371,7 @@ orderly_default_remote_get <- function(root = NULL, locate = TRUE) { ##' `orderly_config.yml` - if no remotes are configured, or if ##' the requested remote does not exist, an error will be thrown. ##' -##' @seealso [orderly::orderly_pull_dependencies()] which provides a +##' @seealso [orderly1::orderly_pull_dependencies()] which provides a ##' higher-level interface to pulling from a remote (including ##' adding the downloaded archive into your orderly repository), and ##' see the documentation underlying the orderly remote driver that @@ -532,7 +532,7 @@ remote_report_update_metadata <- function(name, remote, config) { ##' Pack a bundle on a remote. This is like calling -##' [orderly::orderly_bundle_pack()] on the remote and can be used to +##' [orderly1::orderly_bundle_pack()] on the remote and can be used to ##' extract a long-running report from a server to run (say) on an HPC ##' system. ##' @@ -543,7 +543,7 @@ remote_report_update_metadata <- function(name, remote, config) { ##' be run from the system where the bundle will be run (an HPC ##' head-node or another powerful computer). ##' -##' 2. Run the bundle using [orderly::orderly_bundle_run()] +##' 2. Run the bundle using [orderly1::orderly_bundle_run()] ##' ##' 3. Re-import the completed bundle using ##' `orderly_bundle_import_remote` which sends the zip @@ -553,7 +553,7 @@ remote_report_update_metadata <- function(name, remote, config) { ##' root. However, the `root` argument may still be used to find ##' your remote configuration. Alternatively, if your `remote` ##' argument is an orderly remote (e.g., -##' [orderly::orderly_remote_path()], or `orderlyweb`'s +##' [orderly1::orderly_remote_path()], or `orderlyweb`'s ##' `orderlyweb::orderlyweb_remote`) then the `root` and ##' `locate` arguments will be ignored and this command can be ##' run from anywhere. This is the recommended configuration for diff --git a/R/remote_path.R b/R/remote_path.R index d4cf484a0..a7c525461 100644 --- a/R/remote_path.R +++ b/R/remote_path.R @@ -16,8 +16,8 @@ ##' orderly will use in order to control this remote ##' ##' @export -##' @seealso [orderly::orderly_pull_dependencies()] and -##' [orderly::orderly_pull_archive()], which are the primary ways +##' @seealso [orderly1::orderly_pull_dependencies()] and +##' [orderly1::orderly_pull_archive()], which are the primary ways ##' these remote objects are used. See also ##' [OrderlyWeb](https://github.com/vimc/orderly-web) for a ##' system for hosting orderly repositories over an HTTP API. diff --git a/R/testing.R b/R/testing.R index 662cc35af..78009513f 100644 --- a/R/testing.R +++ b/R/testing.R @@ -26,11 +26,11 @@ ##' @export ##' @examples ##' # Create a new copy of the "minimal" example -##' path <- orderly::orderly_example("minimal") +##' path <- orderly1::orderly_example("minimal") ##' dir(path) ##' ##' # Example reports within this repository: -##' orderly::orderly_list(path) +##' orderly1::orderly_list(path) orderly_example <- function(name, path = tempfile(), run_demo = FALSE, quiet = FALSE, git = FALSE) { path <- prepare_orderly_example(name, path, git = git) diff --git a/docker/Dockerfile b/docker/Dockerfile index 65b79cc08..24a66b553 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -51,7 +51,7 @@ ENV ORDERLY_VERSION $ORDERLY_VERSION COPY . /orderly RUN R CMD INSTALL /orderly && \ - Rscript -e 'orderly:::write_script("/usr/bin")' && \ + Rscript -e 'orderly1:::write_script("/usr/bin")' && \ cp /orderly/inst/create_orderly_demo.sh /usr/bin/ && \ cp /orderly/inst/run_orderly_demo /usr/bin/ && \ rm -rf /orderly diff --git a/docker/schema/create_schema b/docker/schema/create_schema index 405fa380b..4e00f4e87 100755 --- a/docker/schema/create_schema +++ b/docker/schema/create_schema @@ -1,2 +1,2 @@ #!/usr/bin/env Rscript -con <- orderly::orderly_db("destination") +con <- orderly1::orderly_db("destination") diff --git a/inst/create_orderly_demo.sh b/inst/create_orderly_demo.sh index 937145543..76368df4c 100755 --- a/inst/create_orderly_demo.sh +++ b/inst/create_orderly_demo.sh @@ -5,5 +5,5 @@ if [ "$#" -ne 1 ]; then exit 1 fi DEST=$1 -Rscript -e "orderly:::create_orderly_demo(\"$DEST/demo\", git = TRUE)" -Rscript -e "orderly:::prepare_orderly_git_example(\"$DEST/git\", TRUE)" +Rscript -e "orderly1:::create_orderly_demo(\"$DEST/demo\", git = TRUE)" +Rscript -e "orderly1:::prepare_orderly_git_example(\"$DEST/git\", TRUE)" diff --git a/inst/examples/demo/README.md b/inst/examples/demo/README.md index 78f932780..31d50a61e 100644 --- a/inst/examples/demo/README.md +++ b/inst/examples/demo/README.md @@ -48,7 +48,7 @@ other_change_script <- function() { To build the demo repo, run ```r -path <- orderly:::create_orderly_demo() +path <- orderly1:::create_orderly_demo() ``` which will create a new directory with all the output in it. This is also run on teamcity to create an artefact `demo`, and also run via docker as diff --git a/inst/examples/demo/before.R b/inst/examples/demo/before.R index 306e7abaf..ae5d782e8 100644 --- a/inst/examples/demo/before.R +++ b/inst/examples/demo/before.R @@ -5,9 +5,9 @@ other_change_script <- function() { } update_db <- function() { - con <- orderly::orderly_db("source") + con <- orderly1::orderly_db("source") on.exit(DBI::dbDisconnect(con$source)) - orderly:::fake_db(con) + orderly1:::fake_db(con) } add_changelog <- function() { diff --git a/inst/examples/demo/source.R b/inst/examples/demo/source.R index 4389e66d5..b11628520 100644 --- a/inst/examples/demo/source.R +++ b/inst/examples/demo/source.R @@ -1,4 +1,4 @@ function(con) { - orderly:::fake_db(con) + orderly1:::fake_db(con) DBI::dbWriteTable(con$source, "mtcars", mtcars) } diff --git a/inst/examples/demo/src/use_dependency/script.R b/inst/examples/demo/src/use_dependency/script.R index 1ee137cb5..c945da89b 100644 --- a/inst/examples/demo/src/use_dependency/script.R +++ b/inst/examples/demo/src/use_dependency/script.R @@ -5,5 +5,5 @@ par(mar = c(15, 4, .5, .5)) barplot(setNames(d$number, d$name), las = 2) dev.off() -info <- orderly::orderly_run_info() +info <- orderly1::orderly_run_info() saveRDS(info, "info.rds") diff --git a/inst/examples/demo/src/use_dependency_2/script.R b/inst/examples/demo/src/use_dependency_2/script.R index 58cc9abae..2d4c5b544 100644 --- a/inst/examples/demo/src/use_dependency_2/script.R +++ b/inst/examples/demo/src/use_dependency_2/script.R @@ -1,3 +1,3 @@ stopifnot(file.exists("graph.png")) -saveRDS(orderly::orderly_run_info(), "third.rds") +saveRDS(orderly1::orderly_run_info(), "third.rds") diff --git a/inst/init/README.md b/inst/init/README.md index e4e93a999..61a80ee87 100644 --- a/inst/init/README.md +++ b/inst/init/README.md @@ -1 +1 @@ -Files used by `orderly::orderly_init` +Files used by `orderly1::orderly_init` diff --git a/inst/run_orderly_demo b/inst/run_orderly_demo index 5d8a39847..3a139f020 100755 --- a/inst/run_orderly_demo +++ b/inst/run_orderly_demo @@ -6,4 +6,4 @@ if [ "$#" -ne 2 ]; then fi SRC=$1 DEST=$2 -Rscript -e "orderly:::prepare_git_example_from_source(\"$SRC\", \"$DEST\")" +Rscript -e "orderly1:::prepare_git_example_from_source(\"$SRC\", \"$DEST\")" diff --git a/inst/script b/inst/script index 38ea5b69d..c0d4c32aa 100644 --- a/inst/script +++ b/inst/script @@ -1,5 +1,5 @@ tryCatch( - orderly:::main(), + orderly1:::main(), orderly_cli_error = function(e) { message(paste("orderly:", e$message)) q(save = "no", status = 1) diff --git a/man-roxygen/example-orderly-remote.R b/man-roxygen/example-orderly-remote.R index 16ed8518f..8df27079f 100644 --- a/man-roxygen/example-orderly-remote.R +++ b/man-roxygen/example-orderly-remote.R @@ -1,7 +1,7 @@ ## We need two orderly repositories here - one as a "local" and one as ## a "remote" (see ?orderly_pull_archive) -path_remote <- orderly::orderly_example("demo") -path_local <- orderly::orderly_example("demo") +path_remote <- orderly1::orderly_example("demo") +path_local <- orderly1::orderly_example("demo") ## Configure our remote: path_config <- file.path(path_local, "orderly_config.yml") @@ -10,13 +10,13 @@ writeLines(c( txt, "remote:", " default:", - " driver: orderly::orderly_remote_path", + " driver: orderly1::orderly_remote_path", " args:", paste(" path:", path_remote)), path_config) ## Get our remote: -remote <- orderly::orderly_remote(root = path_local) +remote <- orderly1::orderly_remote(root = path_local) ## Can use the remote's methods to interact directly - actual methods ## depend on the remote driver being used. diff --git a/man-roxygen/example-remote.R b/man-roxygen/example-remote.R index ae289b11d..aac289cd8 100644 --- a/man-roxygen/example-remote.R +++ b/man-roxygen/example-remote.R @@ -2,17 +2,17 @@ # This might be read-only for you in practice and available via a # network filesystem or a dropbox folder synced to your computer. # We'll populate this with a pair of reports: -path_remote <- orderly::orderly_example("demo") -id <- orderly::orderly_run("other", list(nmin = 0), +path_remote <- orderly1::orderly_example("demo") +id <- orderly1::orderly_run("other", list(nmin = 0), root = path_remote, echo = FALSE) -orderly::orderly_commit(id, root = path_remote) -id <- orderly::orderly_run("use_dependency", +orderly1::orderly_commit(id, root = path_remote) +id <- orderly1::orderly_run("use_dependency", root = path_remote, echo = FALSE) -orderly::orderly_commit(id, root = path_remote) +orderly1::orderly_commit(id, root = path_remote) # We'll create a an object to interact with this remote using # orderly_remote_path. -remote <- orderly::orderly_remote_path(path_remote) +remote <- orderly1::orderly_remote_path(path_remote) # We can use this object directly remote$list_reports() @@ -24,21 +24,21 @@ remote$list_versions("other") # Now, suppose that you have your "local" copy of this; it shares # the same source (ordinarily these would both be under version # control with git): -path_local <- orderly::orderly_example("demo") +path_local <- orderly1::orderly_example("demo") # If we wanted to run the report "use_dependency" we need to have # a copy of the report "other", on which it depends: -try(orderly::orderly_run("use_dependency", root = path_local)) +try(orderly1::orderly_run("use_dependency", root = path_local)) # We can "pull" dependencies of a report before running -orderly::orderly_pull_dependencies("use_dependency", remote = remote, +orderly1::orderly_pull_dependencies("use_dependency", remote = remote, root = path_local) # Now we can run the report because we have a local copy of the # dependency: -orderly::orderly_run("use_dependency", root = path_local) +orderly1::orderly_run("use_dependency", root = path_local) # We can also directly pull previously run reports: -orderly::orderly_pull_archive("use_dependency", id, remote = remote, +orderly1::orderly_pull_archive("use_dependency", id, remote = remote, root = path_local) -orderly::orderly_list_archive(root = path_local) +orderly1::orderly_list_archive(root = path_local) diff --git a/man/orderly_batch.Rd b/man/orderly_batch.Rd index 2d51e0984..b263b70cb 100644 --- a/man/orderly_batch.Rd +++ b/man/orderly_batch.Rd @@ -32,9 +32,9 @@ Run one report multiple times with different sets of parameters. } \examples{ -path <- orderly::orderly_example("demo") +path <- orderly1::orderly_example("demo") params <- data.frame(nmin = c(0.2, 0.25)) -ids <- orderly::orderly_batch("other", params, root = path) +ids <- orderly1::orderly_batch("other", params, root = path) } \seealso{ \code{\link[=orderly_run]{orderly_run()}} for details of report running diff --git a/man/orderly_bundle_pack.Rd b/man/orderly_bundle_pack.Rd index 8417567ca..b0a65fbea 100644 --- a/man/orderly_bundle_pack.Rd +++ b/man/orderly_bundle_pack.Rd @@ -114,33 +114,33 @@ functions (mostly due to transport costs) so they are intended primarily for very computationally demanding patterns. } \examples{ -path <- orderly::orderly_example("minimal") +path <- orderly1::orderly_example("minimal") # A working directory to export bundles to: workdir <- tempfile() # Pack up the "example" report to go: -res <- orderly::orderly_bundle_pack(workdir, "example", root = path) +res <- orderly1::orderly_bundle_pack(workdir, "example", root = path) # The return value is a list with the id and the path to the zip # file created: res # A list of reports bundled in this directory and their status -orderly::orderly_bundle_list(workdir) +orderly1::orderly_bundle_list(workdir) # Run the bundle (this would ordinarily be done on another computer) -zip <- orderly::orderly_bundle_run(res$path, workdir) +zip <- orderly1::orderly_bundle_run(res$path, workdir) zip # The status has now been updated to reflect the status -orderly::orderly_bundle_list(workdir) +orderly1::orderly_bundle_list(workdir) # We can import this into the orderly tree -orderly::orderly_bundle_import(zip$path, root = path) +orderly1::orderly_bundle_import(zip$path, root = path) # This has now been included in your orderly archive and the # workdir can be safely deleted unlink(workdir, recursive = TRUE) -orderly::orderly_list_archive(path) +orderly1::orderly_list_archive(path) } diff --git a/man/orderly_cleanup.Rd b/man/orderly_cleanup.Rd index 7ad52b05c..bfeebb58d 100644 --- a/man/orderly_cleanup.Rd +++ b/man/orderly_cleanup.Rd @@ -48,19 +48,19 @@ the contents of the \verb{archive/} directory). \examples{ # In a new example orderly, run two reports and commit only the # second one: -path <- orderly::orderly_example("minimal") -id1 <- orderly::orderly_run("example", root = path) -id2 <- orderly::orderly_run("example", root = path) -orderly::orderly_commit(id2, root = path) +path <- orderly1::orderly_example("minimal") +id1 <- orderly1::orderly_run("example", root = path) +id2 <- orderly1::orderly_run("example", root = path) +orderly1::orderly_commit(id2, root = path) # We now have one draft and one archive report: -orderly::orderly_list_drafts(root = path) -orderly::orderly_list_archive(root = path) +orderly1::orderly_list_drafts(root = path) +orderly1::orderly_list_archive(root = path) # To clean up the drafts: -orderly::orderly_cleanup(root = path) +orderly1::orderly_cleanup(root = path) # We now have no draft and one archive reports: -orderly::orderly_list_drafts(root = path) -orderly::orderly_list_archive(root = path) +orderly1::orderly_list_drafts(root = path) +orderly1::orderly_list_archive(root = path) } diff --git a/man/orderly_commit.Rd b/man/orderly_commit.Rd index 8a057e67b..0b6d58b1f 100644 --- a/man/orderly_commit.Rd +++ b/man/orderly_commit.Rd @@ -35,14 +35,14 @@ committed, reports should not be deleted. } \examples{ # In a new example orderly, run a report -path <- orderly::orderly_example("minimal") -id <- orderly::orderly_run("example", root = path) +path <- orderly1::orderly_example("minimal") +id <- orderly1::orderly_run("example", root = path) # To commit it, all we need is the report id -orderly::orderly_commit(id, root = path) +orderly1::orderly_commit(id, root = path) # The report is now committed, and as such could be used as a # dependency in another report and is not subject to deletion by -# orderly::orderly_cleanup -orderly::orderly_list_archive(root = path) +# orderly1::orderly_cleanup +orderly1::orderly_list_archive(root = path) } diff --git a/man/orderly_config.Rd b/man/orderly_config.Rd index 12c4b7f81..08bf28791 100644 --- a/man/orderly_config.Rd +++ b/man/orderly_config.Rd @@ -25,9 +25,9 @@ Retrieve orderly config object. } \examples{ # The orderly demo, with lots of potential reports: -path <- orderly::orderly_example("demo") +path <- orderly1::orderly_example("demo") -orderly::orderly_config(path) +orderly1::orderly_config(path) } \section{Public fields}{ \if{html}{\out{
}} diff --git a/man/orderly_db.Rd b/man/orderly_db.Rd index 04511a396..803caf8c4 100644 --- a/man/orderly_db.Rd +++ b/man/orderly_db.Rd @@ -52,13 +52,13 @@ database stored at the orderly root) } \examples{ # Create an orderly that has a single commited report: -path <- orderly::orderly_example("minimal") -id <- orderly::orderly_run("example", root = path) -orderly::orderly_commit(id, root = path) +path <- orderly1::orderly_example("minimal") +id <- orderly1::orderly_run("example", root = path) +orderly1::orderly_commit(id, root = path) # The source database holds the data that might be accessible via # the 'data' entry in orderly.yml: -db <- orderly::orderly_db("source", root = path) +db <- orderly1::orderly_db("source", root = path) # This is a list, with one connection per database listed in the # orderly_config.yml (an empty list if none are specified): db @@ -68,7 +68,7 @@ DBI::dbDisconnect(db$source) # The destination database holds information about the archived # reports: -db <- orderly::orderly_db("destination", root = path) +db <- orderly1::orderly_db("destination", root = path) DBI::dbListTables(db) # These tables are documented online: diff --git a/man/orderly_deduplicate.Rd b/man/orderly_deduplicate.Rd index 7ce4cf96e..052f91b51 100644 --- a/man/orderly_deduplicate.Rd +++ b/man/orderly_deduplicate.Rd @@ -61,12 +61,12 @@ printed. } \examples{ -path <- orderly::orderly_example("demo") -id1 <- orderly::orderly_run("minimal", root = path) -id2 <- orderly::orderly_run("minimal", root = path) +path <- orderly1::orderly_example("demo") +id1 <- orderly1::orderly_run("minimal", root = path) +id2 <- orderly1::orderly_run("minimal", root = path) orderly_commit(id1, root = path) orderly_commit(id2, root = path) tryCatch( - orderly::orderly_deduplicate(path, dry_run = TRUE), + orderly1::orderly_deduplicate(path, dry_run = TRUE), error = function(e) NULL) } diff --git a/man/orderly_default_remote.Rd b/man/orderly_default_remote.Rd index 92b5dd10a..06c18a997 100644 --- a/man/orderly_default_remote.Rd +++ b/man/orderly_default_remote.Rd @@ -36,30 +36,30 @@ projects. } \examples{ # Same setup as in orderly_remote_path, with a remote orderly: -path_remote <- orderly::orderly_example("demo") -id <- orderly::orderly_run("other", list(nmin = 0), +path_remote <- orderly1::orderly_example("demo") +id <- orderly1::orderly_run("other", list(nmin = 0), root = path_remote, echo = FALSE) -orderly::orderly_commit(id, root = path_remote) -id <- orderly::orderly_run("use_dependency", +orderly1::orderly_commit(id, root = path_remote) +id <- orderly1::orderly_run("use_dependency", root = path_remote, echo = FALSE) -orderly::orderly_commit(id, root = path_remote) +orderly1::orderly_commit(id, root = path_remote) # And a local orderly -path_local <- orderly::orderly_example("demo") +path_local <- orderly1::orderly_example("demo") # We'll create an object to interact with this remote using # orderly_remote_path. -remote <- orderly::orderly_remote_path(path_remote) +remote <- orderly1::orderly_remote_path(path_remote) # There is no remote set by default: -try(orderly::orderly_default_remote_get(root = path_local)) +try(orderly1::orderly_default_remote_get(root = path_local)) # We can set one: -orderly::orderly_default_remote_set(remote, root = path_local) +orderly1::orderly_default_remote_set(remote, root = path_local) # and now we can retrieve it: -orderly::orderly_default_remote_get(root = path_local) +orderly1::orderly_default_remote_get(root = path_local) # Note that this has not affected the other orderly: -try(orderly::orderly_default_remote_get(root = path_remote)) +try(orderly1::orderly_default_remote_get(root = path_remote)) } diff --git a/man/orderly_develop_start.Rd b/man/orderly_develop_start.Rd index 849efb9a3..a67287203 100644 --- a/man/orderly_develop_start.Rd +++ b/man/orderly_develop_start.Rd @@ -123,22 +123,22 @@ The \code{orderly_develop_clean} function will delete dependencies without warning. } \examples{ -path <- orderly::orderly_example("demo") +path <- orderly1::orderly_example("demo") # This report uses a dependency - it requires that the file # incoming.csv exists. This file is created from the report 'other' -orderly::orderly_develop_status("use_dependency", root = path) +orderly1::orderly_develop_status("use_dependency", root = path) # Copy the required dependencies over, in this case from a draft report -orderly::orderly_run("other", list(nmin = 0), root = path, echo = FALSE) -orderly::orderly_develop_start("use_dependency", root = path, +orderly1::orderly_run("other", list(nmin = 0), root = path, echo = FALSE) +orderly1::orderly_develop_start("use_dependency", root = path, use_draft = TRUE) # Files have been copied across into the source directory -orderly::orderly_develop_status("use_dependency", root = path) +orderly1::orderly_develop_status("use_dependency", root = path) # The report can then be developed as needed, interactively. After # we're happy things can be cleaned up with -orderly::orderly_develop_clean("use_dependency", root = path) +orderly1::orderly_develop_clean("use_dependency", root = path) } diff --git a/man/orderly_example.Rd b/man/orderly_example.Rd index 3031c80ed..2fa194b5c 100644 --- a/man/orderly_example.Rd +++ b/man/orderly_example.Rd @@ -42,9 +42,9 @@ repositories, but are used in the package examples and vignettes. } \examples{ # Create a new copy of the "minimal" example -path <- orderly::orderly_example("minimal") +path <- orderly1::orderly_example("minimal") dir(path) # Example reports within this repository: -orderly::orderly_list(path) +orderly1::orderly_list(path) } diff --git a/man/orderly_graph.Rd b/man/orderly_graph.Rd index e1416cda9..3e6c51162 100644 --- a/man/orderly_graph.Rd +++ b/man/orderly_graph.Rd @@ -109,15 +109,15 @@ is missing and we'll try and build it out. } \examples{ -path <- orderly::orderly_example("demo") - -id <- orderly::orderly_run("other", root = path, parameters=list(nmin=0)) -orderly::orderly_commit(id, root = path) -id <- orderly::orderly_run("use_dependency", root = path) -orderly::orderly_commit(id, root = path) -id <- orderly::orderly_run("use_dependency_2", root = path) -orderly::orderly_commit(id, root = path) -orderly::orderly_graph("other", root = path) -orderly::orderly_graph("use_dependency_2", root = path, +path <- orderly1::orderly_example("demo") + +id <- orderly1::orderly_run("other", root = path, parameters=list(nmin=0)) +orderly1::orderly_commit(id, root = path) +id <- orderly1::orderly_run("use_dependency", root = path) +orderly1::orderly_commit(id, root = path) +id <- orderly1::orderly_run("use_dependency_2", root = path) +orderly1::orderly_commit(id, root = path) +orderly1::orderly_graph("other", root = path) +orderly1::orderly_graph("use_dependency_2", root = path, direction = "upstream") } diff --git a/man/orderly_info.Rd b/man/orderly_info.Rd index c25d3cc79..d1edade1c 100644 --- a/man/orderly_info.Rd +++ b/man/orderly_info.Rd @@ -32,7 +32,7 @@ look for the report with \code{id} in archive first and then look in drafts if it can't be found from archive. } \examples{ -path <- orderly::orderly_example("demo") -id <- orderly::orderly_run("minimal", root = path) -orderly::orderly_info(id, "minimal", root = path) +path <- orderly1::orderly_example("demo") +id <- orderly1::orderly_run("minimal", root = path) +orderly1::orderly_info(id, "minimal", root = path) } diff --git a/man/orderly_init.Rd b/man/orderly_init.Rd index 1eac56e8d..ecfca61f9 100644 --- a/man/orderly_init.Rd +++ b/man/orderly_init.Rd @@ -54,7 +54,7 @@ does not exist when a report is run. } \examples{ # Initialise a new orderly repository in an temporary directory: -path <- orderly::orderly_init(tempfile()) +path <- orderly1::orderly_init(tempfile()) # This has created the directory skeleton that you need to get # started using orderly: diff --git a/man/orderly_latest.Rd b/man/orderly_latest.Rd index 73582bdb4..10816934a 100644 --- a/man/orderly_latest.Rd +++ b/man/orderly_latest.Rd @@ -43,20 +43,20 @@ report is always the most recently run report that has been committed (regardless of the order in which they were committed). } \examples{ -path <- orderly::orderly_example("minimal") -id1 <- orderly::orderly_run("example", root = path, echo = FALSE) -id2 <- orderly::orderly_run("example", root = path, echo = FALSE) +path <- orderly1::orderly_example("minimal") +id1 <- orderly1::orderly_run("example", root = path, echo = FALSE) +id2 <- orderly1::orderly_run("example", root = path, echo = FALSE) # With no reports committed there is no latest report: -orderly::orderly_latest("example", root = path, must_work = FALSE) +orderly1::orderly_latest("example", root = path, must_work = FALSE) # Commit the first report and it will be reported as latest: -orderly::orderly_commit(id1, root = path) -orderly::orderly_latest("example", root = path) +orderly1::orderly_commit(id1, root = path) +orderly1::orderly_latest("example", root = path) # Commit the second report and it will be reported as latest instead: -orderly::orderly_commit(id2, root = path) -orderly::orderly_latest("example", root = path) +orderly1::orderly_commit(id2, root = path) +orderly1::orderly_latest("example", root = path) } \seealso{ \link{orderly_list} and diff --git a/man/orderly_list.Rd b/man/orderly_list.Rd index 44c2a7794..2b87cf247 100644 --- a/man/orderly_list.Rd +++ b/man/orderly_list.Rd @@ -28,10 +28,10 @@ will not appear here, as this is simply the set of reports in the } \examples{ # The orderly demo, with lots of potential reports: -path <- orderly::orderly_example("demo") +path <- orderly1::orderly_example("demo") # Reports that _could_ be run: -orderly::orderly_list(path) +orderly1::orderly_list(path) } \seealso{ \code{\link[=orderly_list_archive]{orderly_list_archive()}} and diff --git a/man/orderly_list_drafts.Rd b/man/orderly_list_drafts.Rd index d156b40f3..0d509597d 100644 --- a/man/orderly_list_drafts.Rd +++ b/man/orderly_list_drafts.Rd @@ -35,29 +35,29 @@ columns \code{name} (see \code{\link[=orderly_list]{orderly_list()}}) and \code{ } \examples{ # The orderly demo, with lots of potential reports: -path <- orderly::orderly_example("demo") +path <- orderly1::orderly_example("demo") # Reports that _could_ be run: -orderly::orderly_list(path) +orderly1::orderly_list(path) # Run a report twice: -id1 <- orderly::orderly_run("minimal", root = path) -id2 <- orderly::orderly_run("minimal", root = path) +id1 <- orderly1::orderly_run("minimal", root = path) +id2 <- orderly1::orderly_run("minimal", root = path) # We can see both drafts: -orderly::orderly_list_drafts(path) +orderly1::orderly_list_drafts(path) # Nothing is in the archive: -orderly::orderly_list_archive(path) +orderly1::orderly_list_archive(path) # Commit a report: -orderly::orderly_commit(id2, root = path) +orderly1::orderly_commit(id2, root = path) # Only one draft now -orderly::orderly_list_drafts(path) +orderly1::orderly_list_drafts(path) # And the second report is in the archive: -orderly::orderly_list_archive(path) +orderly1::orderly_list_archive(path) } \seealso{ \code{\link[=orderly_list]{orderly_list()}}, which lists the names of diff --git a/man/orderly_list_metadata.Rd b/man/orderly_list_metadata.Rd index 786737c5a..fd55be55d 100644 --- a/man/orderly_list_metadata.Rd +++ b/man/orderly_list_metadata.Rd @@ -30,8 +30,8 @@ result of doing \code{\link[=orderly_pull_archive]{orderly_pull_archive()}} with downloaded and not the report contents itself. } \examples{ -path <- orderly::orderly_example("minimal") +path <- orderly1::orderly_example("minimal") # No metadata-only reports will be present, unless you have run -# orderly::orderly_pull_archive(..., recursive = FALSE) -orderly::orderly_list_metadata(path) +# orderly1::orderly_pull_archive(..., recursive = FALSE) +orderly1::orderly_list_metadata(path) } diff --git a/man/orderly_log.Rd b/man/orderly_log.Rd index 1777ef935..21b0d5322 100644 --- a/man/orderly_log.Rd +++ b/man/orderly_log.Rd @@ -22,8 +22,8 @@ orderly_log(topic, value) returns a logical indicating if logging was previously enabled. This allows patterns like: -\if{html}{\out{
}}\preformatted{if (!orderly::orderly_log_off()) \{ - on.exit(orderly::orderly_log_on()) +\if{html}{\out{
}}\preformatted{if (!orderly1::orderly_log_off()) \{ + on.exit(orderly1::orderly_log_on()) \} }\if{html}{\out{
}} @@ -48,20 +48,20 @@ format, etc. } \examples{ # We are going to log things below -logging_was_enabled <- orderly::orderly_log_on() +logging_was_enabled <- orderly1::orderly_log_on() # About orderly log messages: # Orderly log messages have the form "[title] message" -orderly::orderly_log_on() -orderly::orderly_log("title", "message") +orderly1::orderly_log_on() +orderly1::orderly_log("title", "message") # If logging is disabled they are not printed: -orderly::orderly_log_off() -orderly::orderly_log("title", "message") +orderly1::orderly_log_off() +orderly1::orderly_log("title", "message") # Restore to previous settings: if (logging_was_enabled) { - orderly::orderly_log_on() + orderly1::orderly_log_on() } } \seealso{ diff --git a/man/orderly_migrate.Rd b/man/orderly_migrate.Rd index 8e36720a1..805fdb672 100644 --- a/man/orderly_migrate.Rd +++ b/man/orderly_migrate.Rd @@ -64,6 +64,6 @@ create versioned backups as files are changed. \examples{ # Without an orderly repository created by a previous version of # orderly, this function does nothing interesting: -path <- orderly::orderly_example("minimal") -orderly::orderly_migrate(path) +path <- orderly1::orderly_example("minimal") +orderly1::orderly_migrate(path) } diff --git a/man/orderly_new.Rd b/man/orderly_new.Rd index e8f50a948..6c6aac32d 100644 --- a/man/orderly_new.Rd +++ b/man/orderly_new.Rd @@ -54,11 +54,11 @@ orderly root. If that is not found, then a copy from the orderly package is used. This can always be used by using \code{template = "system"}. } \examples{ -path <- orderly::orderly_example("minimal") +path <- orderly1::orderly_example("minimal") # Create a new report with the name "myreport" in this orderly # repository: -orderly::orderly_new("myreport", root = path) +orderly1::orderly_new("myreport", root = path) # The directory will be initialised with a orderly.yml file # containing documentation diff --git a/man/orderly_packages.Rd b/man/orderly_packages.Rd index fd6473c39..4121db418 100644 --- a/man/orderly_packages.Rd +++ b/man/orderly_packages.Rd @@ -23,6 +23,6 @@ List of packages required by all src reports Return details of packages required by all src reports in this orderly repo } \examples{ -path <- orderly::orderly_example("minimal") -orderly::orderly_packages(root = path) +path <- orderly1::orderly_example("minimal") +orderly1::orderly_packages(root = path) } diff --git a/man/orderly_pull_dependencies.Rd b/man/orderly_pull_dependencies.Rd index 4cf96f860..f80454a1a 100644 --- a/man/orderly_pull_dependencies.Rd +++ b/man/orderly_pull_dependencies.Rd @@ -120,17 +120,17 @@ likely change a little over time. # This might be read-only for you in practice and available via a # network filesystem or a dropbox folder synced to your computer. # We'll populate this with a pair of reports: -path_remote <- orderly::orderly_example("demo") -id <- orderly::orderly_run("other", list(nmin = 0), +path_remote <- orderly1::orderly_example("demo") +id <- orderly1::orderly_run("other", list(nmin = 0), root = path_remote, echo = FALSE) -orderly::orderly_commit(id, root = path_remote) -id <- orderly::orderly_run("use_dependency", +orderly1::orderly_commit(id, root = path_remote) +id <- orderly1::orderly_run("use_dependency", root = path_remote, echo = FALSE) -orderly::orderly_commit(id, root = path_remote) +orderly1::orderly_commit(id, root = path_remote) # We'll create a an object to interact with this remote using # orderly_remote_path. -remote <- orderly::orderly_remote_path(path_remote) +remote <- orderly1::orderly_remote_path(path_remote) # We can use this object directly remote$list_reports() @@ -142,24 +142,24 @@ remote$list_versions("other") # Now, suppose that you have your "local" copy of this; it shares # the same source (ordinarily these would both be under version # control with git): -path_local <- orderly::orderly_example("demo") +path_local <- orderly1::orderly_example("demo") # If we wanted to run the report "use_dependency" we need to have # a copy of the report "other", on which it depends: -try(orderly::orderly_run("use_dependency", root = path_local)) +try(orderly1::orderly_run("use_dependency", root = path_local)) # We can "pull" dependencies of a report before running -orderly::orderly_pull_dependencies("use_dependency", remote = remote, +orderly1::orderly_pull_dependencies("use_dependency", remote = remote, root = path_local) # Now we can run the report because we have a local copy of the # dependency: -orderly::orderly_run("use_dependency", root = path_local) +orderly1::orderly_run("use_dependency", root = path_local) # We can also directly pull previously run reports: -orderly::orderly_pull_archive("use_dependency", id, remote = remote, +orderly1::orderly_pull_archive("use_dependency", id, remote = remote, root = path_local) -orderly::orderly_list_archive(root = path_local) +orderly1::orderly_list_archive(root = path_local) } \seealso{ \code{\link[=orderly_remote_path]{orderly_remote_path()}}, which implements the diff --git a/man/orderly_rebuild.Rd b/man/orderly_rebuild.Rd index 8a4795d6c..60bc425b0 100644 --- a/man/orderly_rebuild.Rd +++ b/man/orderly_rebuild.Rd @@ -48,11 +48,11 @@ committed (archive) orderly reports, using the \code{orderly_rebuild} function. } \examples{ -path <- orderly::orderly_example("minimal") -id <- orderly::orderly_run("example", root = path) -orderly::orderly_commit(id, root = path) +path <- orderly1::orderly_example("minimal") +id <- orderly1::orderly_run("example", root = path) +orderly1::orderly_commit(id, root = path) -con <- orderly::orderly_db("destination", root = path) +con <- orderly1::orderly_db("destination", root = path) DBI::dbReadTable(con, "report_version") DBI::dbDisconnect(con) @@ -61,13 +61,13 @@ DBI::dbDisconnect(con) # your own fields - only the fields that orderly looks after can # be recovered!) file.remove(file.path(path, "orderly.sqlite")) -orderly::orderly_rebuild(path) +orderly1::orderly_rebuild(path) file.exists(file.path(path, "orderly.sqlite")) -con <- orderly::orderly_db("destination", root = path) +con <- orderly1::orderly_db("destination", root = path) DBI::dbReadTable(con, "report_version") DBI::dbDisconnect(con) # It is safe to rebuild a database repeatedly, though this can be # slow with larger databases. -orderly::orderly_rebuild(path) +orderly1::orderly_rebuild(path) } diff --git a/man/orderly_remote.Rd b/man/orderly_remote.Rd index 2245341a5..ae30cd8b0 100644 --- a/man/orderly_remote.Rd +++ b/man/orderly_remote.Rd @@ -39,8 +39,8 @@ lower-level objects. \examples{ ## We need two orderly repositories here - one as a "local" and one as ## a "remote" (see ?orderly_pull_archive) -path_remote <- orderly::orderly_example("demo") -path_local <- orderly::orderly_example("demo") +path_remote <- orderly1::orderly_example("demo") +path_local <- orderly1::orderly_example("demo") ## Configure our remote: path_config <- file.path(path_local, "orderly_config.yml") @@ -49,13 +49,13 @@ writeLines(c( txt, "remote:", " default:", - " driver: orderly::orderly_remote_path", + " driver: orderly1::orderly_remote_path", " args:", paste(" path:", path_remote)), path_config) ## Get our remote: -remote <- orderly::orderly_remote(root = path_local) +remote <- orderly1::orderly_remote(root = path_local) ## Can use the remote's methods to interact directly - actual methods ## depend on the remote driver being used. diff --git a/man/orderly_remote_path.Rd b/man/orderly_remote_path.Rd index c6494e32c..a2a558d88 100644 --- a/man/orderly_remote_path.Rd +++ b/man/orderly_remote_path.Rd @@ -29,17 +29,17 @@ repositories might be hosted remotely, including over HTTP APIs. # This might be read-only for you in practice and available via a # network filesystem or a dropbox folder synced to your computer. # We'll populate this with a pair of reports: -path_remote <- orderly::orderly_example("demo") -id <- orderly::orderly_run("other", list(nmin = 0), +path_remote <- orderly1::orderly_example("demo") +id <- orderly1::orderly_run("other", list(nmin = 0), root = path_remote, echo = FALSE) -orderly::orderly_commit(id, root = path_remote) -id <- orderly::orderly_run("use_dependency", +orderly1::orderly_commit(id, root = path_remote) +id <- orderly1::orderly_run("use_dependency", root = path_remote, echo = FALSE) -orderly::orderly_commit(id, root = path_remote) +orderly1::orderly_commit(id, root = path_remote) # We'll create a an object to interact with this remote using # orderly_remote_path. -remote <- orderly::orderly_remote_path(path_remote) +remote <- orderly1::orderly_remote_path(path_remote) # We can use this object directly remote$list_reports() @@ -51,24 +51,24 @@ remote$list_versions("other") # Now, suppose that you have your "local" copy of this; it shares # the same source (ordinarily these would both be under version # control with git): -path_local <- orderly::orderly_example("demo") +path_local <- orderly1::orderly_example("demo") # If we wanted to run the report "use_dependency" we need to have # a copy of the report "other", on which it depends: -try(orderly::orderly_run("use_dependency", root = path_local)) +try(orderly1::orderly_run("use_dependency", root = path_local)) # We can "pull" dependencies of a report before running -orderly::orderly_pull_dependencies("use_dependency", remote = remote, +orderly1::orderly_pull_dependencies("use_dependency", remote = remote, root = path_local) # Now we can run the report because we have a local copy of the # dependency: -orderly::orderly_run("use_dependency", root = path_local) +orderly1::orderly_run("use_dependency", root = path_local) # We can also directly pull previously run reports: -orderly::orderly_pull_archive("use_dependency", id, remote = remote, +orderly1::orderly_pull_archive("use_dependency", id, remote = remote, root = path_local) -orderly::orderly_list_archive(root = path_local) +orderly1::orderly_list_archive(root = path_local) } \seealso{ \code{\link[=orderly_pull_dependencies]{orderly_pull_dependencies()}} and diff --git a/man/orderly_run.Rd b/man/orderly_run.Rd index 3e3cd0fa7..1f4331b81 100644 --- a/man/orderly_run.Rd +++ b/man/orderly_run.Rd @@ -92,7 +92,7 @@ it to the \code{archive} directory. \details{ Parameters are passed to the report as a named list, for example -\if{html}{\out{
}}\preformatted{id <- orderly::orderly_run("other", list(nmin = 0.2), root = path) +\if{html}{\out{
}}\preformatted{id <- orderly1::orderly_run("other", list(nmin = 0.2), root = path) }\if{html}{\out{
}} (see the examples). The names of the parameters (here, @@ -108,11 +108,11 @@ within the \verb{$env} section (except for any that match the patterns "TOKEN", "PAT" or "PASS"). } \examples{ -path <- orderly::orderly_example("demo") +path <- orderly1::orderly_example("demo") # To run most reports, provide the report name (and the path if # not running in the working directory, as is the case here): -id <- orderly::orderly_run("minimal", root = path) +id <- orderly1::orderly_run("minimal", root = path) # Every report gets a unique identifier, based on the time (it is # ISO 8601 time with random hex appended to end) @@ -120,7 +120,7 @@ id # After being run, a report is a "draft" and will exist in the # drafts directory: -orderly::orderly_list_drafts(root = path) +orderly1::orderly_list_drafts(root = path) # Draft reports are always stored in the path # /draft//, so we have @@ -130,7 +130,7 @@ dir(file.path(path, "draft", "minimal", id)) # If a report has parameters, then these must be passed in as a # named list. -id <- orderly::orderly_run("other", list(nmin = 0.2), root = path) +id <- orderly1::orderly_run("other", list(nmin = 0.2), root = path) # These parameters can be used in SQL queries or in the report # code. diff --git a/man/orderly_run_info.Rd b/man/orderly_run_info.Rd index 7783cb6f9..fe8313f06 100644 --- a/man/orderly_run_info.Rd +++ b/man/orderly_run_info.Rd @@ -30,18 +30,18 @@ It is important that this data is treated as \emph{readonly}! } \examples{ -path <- orderly::orderly_example("demo") +path <- orderly1::orderly_example("demo") # This example uses orderly_run_info within its script, saving the # output to "output.rds" readLines(file.path(path, "src", "use_dependency", "script.R")) # Run the dependency: -id <- orderly::orderly_run("other", list(nmin = 0), root = path) -orderly::orderly_commit(id, root = path) +id <- orderly1::orderly_run("other", list(nmin = 0), root = path) +orderly1::orderly_commit(id, root = path) # Then the report -id <- orderly::orderly_run("use_dependency", root = path) +id <- orderly1::orderly_run("use_dependency", root = path) # This is the contents: readRDS(file.path(path, "draft", "use_dependency", id, "info.rds")) diff --git a/man/orderly_run_remote.Rd b/man/orderly_run_remote.Rd index 977dbb2c6..4c0f1bdab 100644 --- a/man/orderly_run_remote.Rd +++ b/man/orderly_run_remote.Rd @@ -87,10 +87,10 @@ Run a report on a remote server. Note that this is only supported for remotes using OrderlyWeb at present. } \examples{ -path_remote <- orderly::orderly_example("demo") -path_local <- orderly::orderly_example("demo") -remote <- orderly::orderly_remote_path(path_remote) +path_remote <- orderly1::orderly_example("demo") +path_local <- orderly1::orderly_example("demo") +remote <- orderly1::orderly_remote_path(path_remote) # Currently, path remotes don't support run -try(orderly::orderly_run_remote( +try(orderly1::orderly_run_remote( "minimal", remote = remote, root = path_local)) } diff --git a/man/orderly_search.Rd b/man/orderly_search.Rd index 0807f3f8f..fda2dbf57 100644 --- a/man/orderly_search.Rd +++ b/man/orderly_search.Rd @@ -119,7 +119,7 @@ only supported namespaces are \code{tag} and \code{parameter}. # "dataset" and "plot" - the "dataset" tag will always be applied # as it is listed in the orderly.yml but we can still add the # "plot" tag interactively -root <- orderly::orderly_example("demo") +root <- orderly1::orderly_example("demo") # A helper function to mass-produce reports will reduce noise a bit run1 <- function(nmin, tags = NULL) { @@ -133,37 +133,37 @@ ids <- c(run1(0.1), run1(0.2, "plot"), run1(0.3)) # We can then ask for all reports where the parameter nmin was more # than some value -orderly::orderly_search("parameter:nmin > 0.15", "other", root = root) +orderly1::orderly_search("parameter:nmin > 0.15", "other", root = root) # Or use "&&" to find tags within a range -orderly::orderly_search("parameter:nmin > 0.1 && parameter:nmin < 0.3", +orderly1::orderly_search("parameter:nmin > 0.1 && parameter:nmin < 0.3", "other", root = root) # If a parameter is not present in some versions of a report you # can use is.null to test for it (this is only ever the case if # you have altered a report definition to add or remove a # parameter) -orderly::orderly_search("is.null(parameter:nmin)", "other", root = root) +orderly1::orderly_search("is.null(parameter:nmin)", "other", root = root) # We can look for tags -orderly::orderly_search("tag:plot", "other", root = root) +orderly1::orderly_search("tag:plot", "other", root = root) # or exclude them -orderly::orderly_search("!tag:plot", "other", root = root) +orderly1::orderly_search("!tag:plot", "other", root = root) # or combine that with the presence/absence of a tag -orderly::orderly_search("parameter:nmin > 0.15 && !tag:plot", +orderly1::orderly_search("parameter:nmin > 0.15 && !tag:plot", "other", root = root) # Use latest() over a query to find the latest report matching the # query expression. -orderly::orderly_search("latest(parameter:nmin > 0.15)", +orderly1::orderly_search("latest(parameter:nmin > 0.15)", "other", root = root) # If no reports are found, then a zero-length character vector is returned -orderly::orderly_search("parameter:nmin > 0.4", "other", root = root) +orderly1::orderly_search("parameter:nmin > 0.4", "other", root = root) # Or, in the case of latest(), NA -orderly::orderly_search("latest(parameter:nmin > 0.4)", +orderly1::orderly_search("latest(parameter:nmin > 0.4)", "other", root = root) } diff --git a/man/orderly_test_start.Rd b/man/orderly_test_start.Rd index 16b474a85..6a5dc8f15 100644 --- a/man/orderly_test_start.Rd +++ b/man/orderly_test_start.Rd @@ -79,7 +79,7 @@ the report hands back to the user. } \details{ Previous versions of orderly changed into the created directory -when using \code{orderly::orderly_test_start}, which allowed +when using \code{orderly1::orderly_test_start}, which allowed interactive testing of a report, including ensuring that it has created all expected outputs. However, CRAN rules do not allow changing the working directory, which significantly reduces the @@ -99,14 +99,14 @@ the expected artefacts } \examples{ -path <- orderly::orderly_example("minimal") -p <- orderly::orderly_test_start("example", root = path) +path <- orderly1::orderly_example("minimal") +p <- orderly1::orderly_test_start("example", root = path) # The data in the orderly example is now available to use dat # Check to see which artefacts have been created so far: -orderly::orderly_test_check(p) +orderly1::orderly_test_check(p) # Manually the code that this report has in its script png(file.path(p, "mygraph.png")) @@ -114,5 +114,5 @@ barplot(setNames(dat$number, dat$name), las = 2) dev.off() # We now confirm that the artefact has been created: -orderly::orderly_test_check(p) +orderly1::orderly_test_check(p) } diff --git a/man/orderly_use.Rd b/man/orderly_use.Rd index 10076bd23..21418be9d 100644 --- a/man/orderly_use.Rd +++ b/man/orderly_use.Rd @@ -94,7 +94,7 @@ useful if you are using (or will use) git, but it is harmless at worst. } \examples{ -path <- orderly::orderly_example("minimal") +path <- orderly1::orderly_example("minimal") # Suppose we wanted to use the mtcars data within our report. # First, the file must exist: @@ -102,10 +102,10 @@ write.csv(mtcars, file.path(path, "src", "example", "mtcars.csv"), row.names = FALSE) # Preview expected changes -orderly::orderly_use_resource("mtcars.csv", "example", path, edit = FALSE) +orderly1::orderly_use_resource("mtcars.csv", "example", path, edit = FALSE) # Modify the orderly.yml file within src/example: -orderly::orderly_use_resource("mtcars.csv", "example", path, prompt = FALSE) +orderly1::orderly_use_resource("mtcars.csv", "example", path, prompt = FALSE) # The result is a file that now has a 'resources' section # containing our new file diff --git a/tests/testthat/create-testing.R b/tests/testthat/create-testing.R index 1e1e172ce..d22efa549 100755 --- a/tests/testthat/create-testing.R +++ b/tests/testthat/create-testing.R @@ -2,4 +2,4 @@ if (file.exists("demo")) { unlink("demo", recursive = TRUE) } -orderly:::create_orderly_demo("demo") +orderly1:::create_orderly_demo("demo") diff --git a/tests/testthat/examples/depends/src/depend/script.R b/tests/testthat/examples/depends/src/depend/script.R index 829508615..835b3e05c 100644 --- a/tests/testthat/examples/depends/src/depend/script.R +++ b/tests/testthat/examples/depends/src/depend/script.R @@ -4,4 +4,4 @@ par(mar = c(15, 4, .5, .5)) barplot(setNames(dat$number, dat$name), las = 2) dev.off() -saveRDS(orderly::orderly_run_info(), "output.rds") +saveRDS(orderly1::orderly_run_info(), "output.rds") diff --git a/tests/testthat/examples/depends/src/depend2/script.R b/tests/testthat/examples/depends/src/depend2/script.R index c68f83bf6..731b8fb12 100644 --- a/tests/testthat/examples/depends/src/depend2/script.R +++ b/tests/testthat/examples/depends/src/depend2/script.R @@ -2,4 +2,4 @@ dat1 <- readRDS("previous1.rds") dat2 <- readRDS("previous2.rds") saveRDS(list(dat1, dat2), "results.rds") -saveRDS(orderly::orderly_run_info(), "output.rds") +saveRDS(orderly1::orderly_run_info(), "output.rds") diff --git a/tests/testthat/examples/depends/src/depend3/script.R b/tests/testthat/examples/depends/src/depend3/script.R index c68f83bf6..731b8fb12 100644 --- a/tests/testthat/examples/depends/src/depend3/script.R +++ b/tests/testthat/examples/depends/src/depend3/script.R @@ -2,4 +2,4 @@ dat1 <- readRDS("previous1.rds") dat2 <- readRDS("previous2.rds") saveRDS(list(dat1, dat2), "results.rds") -saveRDS(orderly::orderly_run_info(), "output.rds") +saveRDS(orderly1::orderly_run_info(), "output.rds") diff --git a/tests/testthat/helper-orderly.R b/tests/testthat/helper-orderly.R index 47674e4a0..c7d38d3bc 100644 --- a/tests/testthat/helper-orderly.R +++ b/tests/testthat/helper-orderly.R @@ -88,7 +88,7 @@ prepare_orderly_remote_example <- function(path = tempfile()) { r <- list(remote = list( default = list( - driver = "orderly::orderly_remote_path", + driver = "orderly1::orderly_remote_path", args = list(path = path_remote)))) append_lines(yaml::as.yaml(r), file.path(path_local, "orderly_config.yml")) diff --git a/tests/testthat/test-bundle.R b/tests/testthat/test-bundle.R index 340f69161..e1e485599 100644 --- a/tests/testthat/test-bundle.R +++ b/tests/testthat/test-bundle.R @@ -166,7 +166,7 @@ test_that("Can't extract a bundle onto itself", { test_that("can run a bundle with dependencies", { - path <- orderly::orderly_example("demo") + path <- orderly1::orderly_example("demo") orderly_run_internal("other", parameters = list(nmin = 0), root = path, commit = TRUE, echo = FALSE) @@ -192,7 +192,7 @@ test_that("can run a bundle with dependencies", { test_that("can run a bundle with global file dependencies", { - path <- orderly::orderly_example("demo") + path <- orderly1::orderly_example("demo") path_bundles <- tempfile() path_work <- tempfile() @@ -211,7 +211,7 @@ test_that("can run a bundle with global file dependencies", { test_that("can't cope with connections", { - path <- orderly::orderly_example("demo") + path <- orderly1::orderly_example("demo") path_bundles <- tempfile() expect_error( orderly_bundle_pack(path_bundles, "connection", root = path), @@ -220,7 +220,7 @@ test_that("can't cope with connections", { test_that("can't import an unrun bundle", { - path <- orderly::orderly_example("minimal") + path <- orderly1::orderly_example("minimal") path_bundles <- tempfile() res <- orderly_bundle_pack(path_bundles, "example", root = path) expect_error( @@ -231,7 +231,7 @@ test_that("can't import an unrun bundle", { test_that("sensible error when given junk input", { - path <- orderly::orderly_example("minimal") + path <- orderly1::orderly_example("minimal") tmp <- tempfile(fileext = ".zip") zip_dir(file.path(path, "src"), tmp) expect_error( diff --git a/tests/testthat/test-changelog.R b/tests/testthat/test-changelog.R index 2a064d6e5..8150d68e7 100644 --- a/tests/testthat/test-changelog.R +++ b/tests/testthat/test-changelog.R @@ -239,7 +239,7 @@ test_that("label change requires rebuild", { id2 <- orderly_run("example", root = path, echo = FALSE) expect_error( orderly_commit(id2, root = path), - "changelog labels have changed: rebuild with orderly::orderly_rebuild()", + "changelog labels have changed: rebuild with orderly1::orderly_rebuild()", fixed = TRUE) orderly_rebuild(root = path) diff --git a/tests/testthat/test-config.R b/tests/testthat/test-config.R index 890c43939..f6a88e01e 100644 --- a/tests/testthat/test-config.R +++ b/tests/testthat/test-config.R @@ -124,12 +124,12 @@ test_that("support declaring api server", { dir.create(path) dat <- list(remote = list( main = list( - driver = "orderly::orderly_remote_path", + driver = "orderly1::orderly_remote_path", primary = TRUE, default_branch_only = TRUE, args = list(root = path)), other = list( - driver = "orderly::orderly_remote_path", + driver = "orderly1::orderly_remote_path", args = list(root = path)))) writeLines(yaml::as.yaml(dat), path_orderly_config_yml(path)) cfg <- orderly_config_$new(path) @@ -178,11 +178,11 @@ test_that("api server has only one primary", { dir.create(path) dat <- list(remote = list( main = list( - driver = "orderly::orderly_remote_path", + driver = "orderly1::orderly_remote_path", primary = TRUE, args = list(root = path)), other = list( - driver = "orderly::orderly_remote_path", + driver = "orderly1::orderly_remote_path", primary = TRUE, args = list(root = path)))) @@ -202,7 +202,7 @@ test_that("remote parse check", { dir.create(path) dat <- list(remote = list( myhost = list( - driver = "orderly::orderly_remote_path", + driver = "orderly1::orderly_remote_path", primary = TRUE, args = list(root = path), default_branch_only = "yeah"))) @@ -398,7 +398,7 @@ test_that("warn when using url in remote definition", { append_lines(c( "remote:", " testing:", - " driver: orderly::orderly_remote_path", + " driver: orderly1::orderly_remote_path", " url: https://example.com", " args:", sprintf(" path: %s", path), @@ -564,7 +564,7 @@ test_that("can configure default branch for a remote", { dir.create(path) dat <- list(remote = list( main = list( - driver = "orderly::orderly_remote_path", + driver = "orderly1::orderly_remote_path", primary = TRUE, default_branch_only = TRUE, default_branch = "main", @@ -581,7 +581,7 @@ test_that("migrate master_only", { dir.create(path) dat <- list(remote = list( main = list( - driver = "orderly::orderly_remote_path", + driver = "orderly1::orderly_remote_path", primary = TRUE, master_only = TRUE, args = list(root = path)))) @@ -599,7 +599,7 @@ test_that("disallow both master_only and default_branch_only", { dir.create(path) dat <- list(remote = list( main = list( - driver = "orderly::orderly_remote_path", + driver = "orderly1::orderly_remote_path", primary = TRUE, master_only = TRUE, default_branch_only = TRUE, diff --git a/tests/testthat/test-db.R b/tests/testthat/test-db.R index b87c0a691..82f2b1309 100644 --- a/tests/testthat/test-db.R +++ b/tests/testthat/test-db.R @@ -384,7 +384,7 @@ test_that("Create and verify tags on startup", { append_lines(" - tag3", file.path(root, "orderly_config.yml")) expect_error( orderly_db("destination", root = root), - "tags have changed: rebuild with orderly::orderly_rebuild()", + "tags have changed: rebuild with orderly1::orderly_rebuild()", fixed = TRUE) orderly_rebuild(root) diff --git a/tests/testthat/test-migrate.R b/tests/testthat/test-migrate.R index edb42db42..f3289aaee 100644 --- a/tests/testthat/test-migrate.R +++ b/tests/testthat/test-migrate.R @@ -178,7 +178,7 @@ test_that("require migration", { expect_error(orderly_run("example", root = path, echo = FALSE), "orderly archive needs migrating from 0.0.0 =>", fixed = TRUE) expect_error(orderly_run("example", root = path, echo = FALSE), - "Run orderly::orderly_migrate() to fix", fixed = TRUE) + "Run orderly1::orderly_migrate() to fix", fixed = TRUE) orderly_migrate(path) expect_error(orderly_run("example", root = path, echo = FALSE), NA) }) @@ -234,7 +234,7 @@ test_that("database migrations", { id <- orderly_run("minimal", root = path, echo = FALSE) expect_error( orderly_commit(id, root = path), - "orderly db needs rebuilding with orderly::orderly_rebuild()") + "orderly db needs rebuilding with orderly1::orderly_rebuild()") orderly_rebuild(path) diff --git a/tests/testthat/test-orderly.R b/tests/testthat/test-orderly.R index 3a428cd4b..a90a38a86 100644 --- a/tests/testthat/test-orderly.R +++ b/tests/testthat/test-orderly.R @@ -188,7 +188,7 @@ test_that("archive directory is created when needed", { test_that("onload can be rerun", { v <- cache$current_archive_version cache$current_archive_version <- NULL - orderly:::.onLoad() + orderly1:::.onLoad() expect_equal(cache$current_archive_version, v) }) diff --git a/tests/testthat/test-remote.R b/tests/testthat/test-remote.R index bc189fdd7..d48c62350 100644 --- a/tests/testthat/test-remote.R +++ b/tests/testthat/test-remote.R @@ -175,7 +175,7 @@ test_that("silently ignore missing slack url, but resolve args", { append_lines( c("remote:", " default:", - " driver: orderly::orderly_remote_path", + " driver: orderly1::orderly_remote_path", " args:", " path: $ORDERLY_UNSET_REMOTE_PATH", " slack_url: $ORDERLY_UNSET_SLACK_URL"), @@ -187,7 +187,7 @@ test_that("silently ignore missing slack url, but resolve args", { remote <- withr::with_envvar( c(ORDERLY_UNSET_REMOTE_PATH = path), get_remote("default", config)) - expect_equal(length(orderly:::cache$remotes), 1L) + expect_equal(length(orderly1:::cache$remotes), 1L) expect_null(attr(remote, "slack_url")) expect_false(attr(remote, "primary")) @@ -196,7 +196,7 @@ test_that("silently ignore missing slack url, but resolve args", { c(ORDERLY_UNSET_REMOTE_PATH = path, ORDERLY_UNSET_SLACK_URL = "http://example.com/slack"), get_remote("default", config)) - expect_equal(length(orderly:::cache$remotes), 1L) + expect_equal(length(orderly1:::cache$remotes), 1L) expect_equal(attr(remote, "slack_url"), "http://example.com/slack") expect_false(attr(remote, "primary")) }) @@ -213,7 +213,7 @@ test_that("get remote", { txt, "remote:", " default:", - " driver: orderly::orderly_remote_path", + " driver: orderly1::orderly_remote_path", " args:", paste(" path:", path_remote)), path_config) @@ -232,7 +232,7 @@ test_that("teams url can be configured and silently ignored if missing", { append_lines( c("remote:", " default:", - " driver: orderly::orderly_remote_path", + " driver: orderly1::orderly_remote_path", " args:", " path: $ORDERLY_PATH", " teams_url: $ORDERLY_TEAMS_URL"), @@ -244,7 +244,7 @@ test_that("teams url can be configured and silently ignored if missing", { remote <- withr::with_envvar( c(ORDERLY_PATH = path), get_remote("default", config)) - expect_equal(length(orderly:::cache$remotes), 1L) + expect_equal(length(orderly1:::cache$remotes), 1L) expect_null(attr(remote, "teams_url")) expect_false(attr(remote, "primary")) @@ -253,7 +253,7 @@ test_that("teams url can be configured and silently ignored if missing", { c(ORDERLY_PATH = path, ORDERLY_TEAMS_URL = "http://example.com/slack"), get_remote("default", config)) - expect_equal(length(orderly:::cache$remotes), 1L) + expect_equal(length(orderly1:::cache$remotes), 1L) expect_equal(attr(remote, "teams_url"), "http://example.com/slack") expect_false(attr(remote, "primary")) }) diff --git a/tests/testthat/test-slack.R b/tests/testthat/test-slack.R index 5db04bbbe..c56947046 100644 --- a/tests/testthat/test-slack.R +++ b/tests/testthat/test-slack.R @@ -156,7 +156,7 @@ test_that("main interface", { writeLines( c("remote:", " myserver:", - " driver: orderly::orderly_remote_path", + " driver: orderly1::orderly_remote_path", " args:", paste(" path:", path), " slack_url: https://httpbin.org/post", @@ -186,12 +186,12 @@ test_that("main interface", { append_lines(c( "remote:", " testing:", - " driver: orderly::orderly_remote_path", + " driver: orderly1::orderly_remote_path", " args:", sprintf(" path: %s", path), " slack_url: https://httpbin.org/post", " production:", - " driver: orderly::orderly_remote_path", + " driver: orderly1::orderly_remote_path", " args:", sprintf(" path: %s", path), " slack_url: https://httpbin.org/post", @@ -431,7 +431,7 @@ test_that("main teams interface", { writeLines( c("remote:", " myserver:", - " driver: orderly::orderly_remote_path", + " driver: orderly1::orderly_remote_path", " args:", paste(" path:", path), " teams_url: https://httpbin.org/post", @@ -468,7 +468,7 @@ test_that("look up environment variables before hook send", { writeLines( c("remote:", " myserver:", - " driver: orderly::orderly_remote_path", + " driver: orderly1::orderly_remote_path", " args:", paste(" path:", path), " slack_url: $ORDERLY_SLACK_URL", diff --git a/vignettes/bundles.Rmd b/vignettes/bundles.Rmd index 4ec27ca69..3d0009b27 100644 --- a/vignettes/bundles.Rmd +++ b/vignettes/bundles.Rmd @@ -30,15 +30,15 @@ Fifth, that you trust your remote machine with your data, and that the remote ma We will use the orderly demo example, and pack up the `use_dependency` report. ```{r} -path <- orderly::orderly_example("demo") +path <- orderly1::orderly_example("demo") ``` The `use_dependency` report has a dependency, which we run ```{r} -id <- orderly::orderly_run("other", parameters = list(nmin = 0), +id <- orderly1::orderly_run("other", parameters = list(nmin = 0), echo = FALSE, root = path) -orderly::orderly_commit(id, root = path) +orderly1::orderly_commit(id, root = path) ``` We need a place that we'll put the bundles: @@ -50,7 +50,7 @@ path_bundles <- tempfile() Now, we can pack up `use_dependency` to run ```{r} -bundle <- orderly::orderly_bundle_pack(path_bundles, "use_dependency", +bundle <- orderly1::orderly_bundle_pack(path_bundles, "use_dependency", root = path) bundle ``` @@ -69,24 +69,24 @@ Once the files have been moved we can run it with: ```{r} workdir <- tempfile() -res <- orderly::orderly_bundle_run(bundle$path, workdir) +res <- orderly1::orderly_bundle_run(bundle$path, workdir) ``` With the `workdir` being a directory that you want the report to be run in. This can be the same as the path the incoming zip file is found, if you want, but this will make it harder to know what has been run already or not. This creates _another_ zip file, but this time contains the results of running the report. -The result can be imported into order by using `orderly::orderly_bundle_import` with the path to the zip file: +The result can be imported into order by using `orderly1::orderly_bundle_import` with the path to the zip file: ```{r} -orderly::orderly_bundle_import(res$path, root = path) +orderly1::orderly_bundle_import(res$path, root = path) ``` The copy of `use_dependency` is now in the archive and can be used like any other orderly report ```{r} -orderly::orderly_list_archive(path) -orderly::orderly_graph("other", root = path) +orderly1::orderly_list_archive(path) +orderly1::orderly_graph("other", root = path) ``` ## Limitations diff --git a/vignettes/changelog.Rmd b/vignettes/changelog.Rmd index 3c21f0387..942b69b27 100644 --- a/vignettes/changelog.Rmd +++ b/vignettes/changelog.Rmd @@ -41,7 +41,7 @@ unaltered. Messages can be provided to `orderly_run` (or `orderly run` on the command line) and these are required to be in the format `[label] value`. -Once a report is run (via `orderly::orderly_run()`, or via `orderly run` on the command line), the given changelog, along with any +Once a report is run (via `orderly1::orderly_run()`, or via `orderly run` on the command line), the given changelog, along with any message, is compared with the last committed version of this report, and entries that are introduced on this round are identified. We add the report id to the entries, and a randomly generated unique id to each new entry. This is saved in `orderly_run.rds` along with other report metadata. diff --git a/vignettes/orderly.Rmd b/vignettes/orderly.Rmd index 963fcd18e..ef4f98154 100644 --- a/vignettes/orderly.Rmd +++ b/vignettes/orderly.Rmd @@ -20,7 +20,7 @@ orderly_file <- function(...) { system.file(..., package = "orderly", mustWork = TRUE) } -path <- orderly:::prepare_orderly_example("nodata") +path <- orderly1:::prepare_orderly_example("nodata") path_example <- file.path(path, "src", "example") ## Even simpler unlink(file.path(path, "archive"), recursive = TRUE) @@ -112,7 +112,7 @@ Then if one of the dependencies of a report changes (the used data, code, etc), ## Example -To illustrate, we will start with a minimal example (you can use `orderly::orderly_init` to create a similar structure directly), and we will build it up to demonstrate `orderly` features. In the most minimal example, we want to run a script that creates a graph. It uses no external resources. +To illustrate, we will start with a minimal example (you can use `orderly1::orderly_init` to create a similar structure directly), and we will build it up to demonstrate `orderly` features. In the most minimal example, we want to run a script that creates a graph. It uses no external resources. ``` {r comment = NA, echo = FALSE} dir_tree(path) @@ -140,10 +140,10 @@ it can be formatted freely (there are no magic comments, etc). There are no res ### Running the report -To run the report, use `orderly::orderly_run` (typically one would be in the `orderly` root and so the `root` directory could be omitted, but within this vignette we use a temporary directory): +To run the report, use `orderly1::orderly_run` (typically one would be in the `orderly` root and so the `root` directory could be omitted, but within this vignette we use a temporary directory): ```{r} -id <- orderly::orderly_run("example", root = path) +id <- orderly1::orderly_run("example", root = path) ``` The return value is the id of the report (also printed on the @@ -176,7 +176,7 @@ there are the files: Every time a report is run it will create a new directory at this level with a new id. Running the report again now might create the -directory ``r file.path("example", orderly:::new_report_id())`` +directory ``r file.path("example", orderly1:::new_report_id())`` We store the copies of files as run by `orderly` so that even if the input files change we can still easily get back to previous @@ -186,13 +186,13 @@ from any changes to the underlying source. You can see the list of draft reports like so: ``` {r } -orderly::orderly_list_drafts(root = path) +orderly1::orderly_list_drafts(root = path) ``` Once you're happy with a report, then "commit" it with ``` {r collapse = TRUE} -orderly::orderly_commit(id, root = path) +orderly1::orderly_commit(id, root = path) ``` After this step our directory structure looks like: @@ -205,10 +205,10 @@ This looks very like the previous, but files have been moved from being within ` ## Creating a report -First, run `orderly::orderly_new` to create a directory within `src`. The name is important and should not contain spaces (nor should it change as this will change the key report id and you'll lose a chain of history), then edit the file `orderly.yml` within that directory. +First, run `orderly1::orderly_new` to create a directory within `src`. The name is important and should not contain spaces (nor should it change as this will change the key report id and you'll lose a chain of history), then edit the file `orderly.yml` within that directory. ``` {r } -orderly::orderly_new("new", root = path) +orderly1::orderly_new("new", root = path) ``` which results in a directory structure like: @@ -388,7 +388,7 @@ parameters: This would declare that a report takes two parameters `a` (with a default of 1), and `b` (with no default). Running the report would then look like: ```r -orderly::orderly_run("reportname", list(a = 10, b = 100)) +orderly1::orderly_run("reportname", list(a = 10, b = 100)) ``` These parameters are then present in the environment of the report, so the code can use values `a` and `b`. @@ -440,7 +440,7 @@ versions. This process can be automated by running ```{r} -orderly::orderly_use_gitignore(root = path, prompt = FALSE) +orderly1::orderly_use_gitignore(root = path, prompt = FALSE) ``` (the default, `prompt = TRUE` will request user confirmation before writing the `.gitignore` file). @@ -565,7 +565,7 @@ session). This will likely be more pleasant to work with. The advantage of using environment variables is that you can add the `orderly_envir.yml` file to your `.gitignore` and avoid committing system-dependent data to the central repository (see -`orderly::orderly_use_gitignore`) to help automate this. +`orderly1::orderly_use_gitignore`) to help automate this. To avoid leaving passwords in plain text, you can use [`vault`](https://www.vaultproject.io) (along with the R client [`vaultr`](https://cran.r-project.org/package=vaultr)) to retrieve them. @@ -646,16 +646,16 @@ database: default_instance: $DEFAULT_INSTANCE ``` -Here - staging and production have different hostnames (`production.example.org` and `staging.example.org`) and different passwords (retrieved using environment variables) and the default instance is set with another environment variable (`$DEFAULT_INSTANCE`, which must be one of `production` or `staging`). To switch between databases, you can set that variable, or pass the `instance` argument to `orderly::orderly_run` and friends, as: +Here - staging and production have different hostnames (`production.example.org` and `staging.example.org`) and different passwords (retrieved using environment variables) and the default instance is set with another environment variable (`$DEFAULT_INSTANCE`, which must be one of `production` or `staging`). To switch between databases, you can set that variable, or pass the `instance` argument to `orderly1::orderly_run` and friends, as: ```r -orderly::orderly_run(name, instance = "production") +orderly1::orderly_run(name, instance = "production") ``` or ```r -orderly::orderly_run(name, instance = "staging") +orderly1::orderly_run(name, instance = "staging") ``` If there is more than one database configured, then the interpretation of `instance` is a little more nuanced. For example, suppose we have this (abridged) database configuration: @@ -682,7 +682,7 @@ database: Then we can pass in a string like `production` in as the instance, e.g., ``` -orderly::orderly_run(name, instance = "production") +orderly1::orderly_run(name, instance = "production") ``` as the `source` database will select the `production` instance and as there are no instances configured for the `extra` database we will ignore the argument when connecting to `extra`. @@ -716,7 +716,7 @@ database: Then it is possible to select *different* instances for each database, such as: ``` -orderly::orderly_run(name, +orderly1::orderly_run(name, instance = c(source = "production", extra = "staging")) ``` @@ -766,9 +766,9 @@ Because orderly works in a directory that is not the same as the source director In order to make this easier, orderly has a set of functions to help develop a report within the source directory. These functions are: -* `orderly::orderly_develop_start` which copies files *into* your source copy -* `orderly::orderly_develop_status` which reports on the status of your source -* `orderly::orderly_develop_clean` which cleans up files that orderly copied +* `orderly1::orderly_develop_start` which copies files *into* your source copy +* `orderly1::orderly_develop_status` which reports on the status of your source +* `orderly1::orderly_develop_clean` which cleans up files that orderly copied This section illustrates the idea, creating a new report that will depend on an artefact from a previous report. Here is the state of our orderly tree from before: @@ -807,10 +807,10 @@ The new report has an `orderly.yml` containing yaml_output(readLines(file.path(path_new, "orderly.yml"))) ``` -In order to run this report, we need the file `data.csv` (which contains the output `mydata.csv` from the latest version of the `example` report) to exist. If we wanted to interactively develop the `script.R` we'd have to run `orderly::orderly_run` repeatedly, which will be annoying - and impractical if the report is slow to run. So we can run instead: +In order to run this report, we need the file `data.csv` (which contains the output `mydata.csv` from the latest version of the `example` report) to exist. If we wanted to interactively develop the `script.R` we'd have to run `orderly1::orderly_run` repeatedly, which will be annoying - and impractical if the report is slow to run. So we can run instead: ```{r} -orderly::orderly_develop_start("new", root = path) +orderly1::orderly_develop_start("new", root = path) ``` which copies in the required artefact and we can then change the directory (using something like `setwd("src/new")`) and start working on the report directly. @@ -818,15 +818,15 @@ which copies in the required artefact and we can then change the directory (usin You can see the status of the directory by running ```{r} -orderly::orderly_develop_status("new", root = path) +orderly1::orderly_develop_status("new", root = path) ``` -(the output of this object is likely to change in future versions), which shows that `data.csv` is present, and that it is _derived_ - by which means that orderly knows that it should not persist in the source tree. Files marked as `derived` as `TRUE` are liable for deletion by `orderly::orderly_develop_clean`. The output also shows that `mean.txt` is not present. +(the output of this object is likely to change in future versions), which shows that `data.csv` is present, and that it is _derived_ - by which means that orderly knows that it should not persist in the source tree. Files marked as `derived` as `TRUE` are liable for deletion by `orderly1::orderly_develop_clean`. The output also shows that `mean.txt` is not present. If you have changed directly into the path under development (via `setwd(file.path(path, "src/new"))`) the you can omit the arguments and simply call ```{r, with_path = TRUE, with_path_value = path_new} -orderly::orderly_develop_status() +orderly1::orderly_develop_status() ``` You can then run your script as if it was a normal R script: @@ -840,15 +840,15 @@ source("script.R", echo = TRUE) After which the `data.csv` is present ```{r, with_path = TRUE, with_path_value = path_new} -orderly::orderly_develop_status() +orderly1::orderly_develop_status() ``` -If a newer version of the upstream dependency has become available, you can update the file by running `orderly::orderly_develop_start()` again +If a newer version of the upstream dependency has become available, you can update the file by running `orderly1::orderly_develop_start()` again ```{r, with_path = TRUE, with_path_value = path_new} -id <- orderly::orderly_run("example", root = path) -orderly::orderly_commit(id, root = path) -orderly::orderly_develop_start() +id <- orderly1::orderly_run("example", root = path) +orderly1::orderly_commit(id, root = path) +orderly1::orderly_develop_start() ``` (note that this has updated `data.csv` to use this new id `r id`). @@ -856,8 +856,8 @@ orderly::orderly_develop_start() Finally, you can delete the files that orderly has copied into the source tree: ```{r, with_path = TRUE, with_path_value = path_new, collapse = TRUE} -orderly::orderly_develop_clean() -orderly::orderly_develop_status() +orderly1::orderly_develop_clean() +orderly1::orderly_develop_status() ``` (this function also accepts `name` and `root` as above, required if not working in the source directory) diff --git a/vignettes/patterns.Rmd b/vignettes/patterns.Rmd index 95532c046..bc33af364 100644 --- a/vignettes/patterns.Rmd +++ b/vignettes/patterns.Rmd @@ -20,7 +20,7 @@ The key issues to consider are This is the simplest pattern, and the one that `orderly` has the fewest opinions about. We imagine a single researcher using `orderly` to keep track of a set of analyses. They would configure orderly with an empty `orderly_config.yml`, and would probably add `archive` to `.gitignore` (`drafts` should always be gitignored). -As the researcher develops reports, they create new directories in `src/` using `orderly::orderly_new()`, run the reports on their own system using `orderly::orderly_run()` and commit them into their `archive` using `orderly::orderly_commit()`. +As the researcher develops reports, they create new directories in `src/` using `orderly1::orderly_new()`, run the reports on their own system using `orderly1::orderly_run()` and commit them into their `archive` using `orderly1::orderly_commit()`. The researcher needs to take care that the reports are run in a clean R session, as objects and packages in R's global execution environment are available to their reports. @@ -50,7 +50,7 @@ What we want is that after a particular version of a report has been run, it is For this discussion we will assume two researchers "Alice" and "Bob" (rather than "Researcher A" and "Researcher B"). -Alice develops a report `report-a` on her computer by running `orderly::orderly_new("report-a")` and working with `orderly::orderly_develop_start()` and `orderly::orderly_run()` until she is happy with the results. She then creates a pull request, and Bob approves it (probably after checking that the report runs on his machine too) and merges it. +Alice develops a report `report-a` on her computer by running `orderly1::orderly_new("report-a")` and working with `orderly1::orderly_develop_start()` and `orderly1::orderly_run()` until she is happy with the results. She then creates a pull request, and Bob approves it (probably after checking that the report runs on his machine too) and merges it. Now that this report has been merged into master we need to run a "canonical copy". We do this on a third copy of the sources that are checked out somewhere accessible to *both* Alice and Bob; this might be using Dropbox or another file-sharing platform, or on a network drive visible to both users. @@ -61,7 +61,7 @@ Now we have both Alice and Bob able to get the *source* of `report-a` and our sh ```yaml remote: default: - driver: orderly::orderly_remote_path + driver: orderly1::orderly_remote_path args: path: $ORDERLY_PATH_DEFAULT_REMOTE ``` @@ -83,7 +83,7 @@ ORDERLY_PATH_DEFAULT_REMOTE: c:/Bob/Documents/Dropbox/our-project With this done, Bob can get a copy of `report-a` by running ```r -orderly::orderly_pull_archive("report-a") +orderly1::orderly_pull_archive("report-a") ``` which will copy the latest version of the report from the shared archive into their personal archive. A this point, Bob has *exactly* the copy of `report-a` that was run on the shared archive. In the same way that Alice and Bob can exchange git sha hashes to ensure that they are on the same version of the source tree, they can now exchange report ids and ensure that they are looking at the same output. @@ -91,7 +91,7 @@ which will copy the latest version of the report from the shared archive into th If you are working on a report that has a dependency (say `report-b`, which depends on `report-a`), you can automatically pull its dependencies by running ```r -orderly::orderly_pull_dependencies("report-b") +orderly1::orderly_pull_dependencies("report-b") ``` This is especially useful if `report-b` has many dependencies, or depends on particular versions of a report. @@ -102,7 +102,7 @@ There are a number of features about the system here that might not be obvious a * Because each report exists in its own directory within `src/` we reduce the potential for conflicts. In a collaborative analysis where multiple files are shared across analyses, it is easy to have conflicts. `orderly` forces analyses into separate directories, which means most of the time it is trivial to merge even long-lived branches. This is particularly important with relatively new users of git. * Because every report gets a unique identifier, it is straightforward to combine outputs that were run on different machines. In the example above this is a centralised system (one canonical source, several destinations) but in theory more complicated distributed patterns are possible. -* On the central server, the archive directory is an "append only" system; nothing is ever modified. This seems wasteful at first as there can be lots of copies of a report, but disk space is cheaper than researcher time (and you can remove redundancy with `orderly::orderly_deduplicate`) +* On the central server, the archive directory is an "append only" system; nothing is ever modified. This seems wasteful at first as there can be lots of copies of a report, but disk space is cheaper than researcher time (and you can remove redundancy with `orderly1::orderly_deduplicate`) ## Group of researchers, sharing via server @@ -130,7 +130,7 @@ remote: Once this is done, both Alice and Bob can run reports *on* that server, for example ```r -orderly::orderly_run_remote("internal-2017-population-TUV-MHL", remote = "science") +orderly1::orderly_run_remote("internal-2017-population-TUV-MHL", remote = "science") ``` ![](patterns_run_remote.gif){width=700px} @@ -138,12 +138,12 @@ orderly::orderly_run_remote("internal-2017-population-TUV-MHL", remote = "scienc this will print to screen the log, just as if it were running locally, though it is in fact running on a fresh R session remotely. After being run, this report is available to everyone and can be pulled as above ```r -orderly::orderly_pull_archive("report-a", remote = "default") +orderly1::orderly_pull_archive("report-a", remote = "default") ``` ## Using staging environments -This can be extended further with the use of "staging environments". This extends the above (two) scenario so that we have multiple remote orderly archives. These might be shared file archives, using `orderly::orderly_remote_path` or server hosted archives using `orderlyweb::orderlyweb_remote` or even a combination. +This can be extended further with the use of "staging environments". This extends the above (two) scenario so that we have multiple remote orderly archives. These might be shared file archives, using `orderly1::orderly_remote_path` or server hosted archives using `orderlyweb::orderlyweb_remote` or even a combination. We designate one of these remotes to be our production environment and the others to be staging. In our work we have used the name pairs `production/science` and `real/testing`; the names used do not matter. @@ -167,13 +167,13 @@ remote: Now, as part of the pull request review procedure, the reviewer will run the report on the staging environment, which means that it should work without error on the production environment if they have been set up the same way. ```r -orderly::orderly_run_remote("report-a", remote = "staging", ref = "origin/myfeature") +orderly1::orderly_run_remote("report-a", remote = "staging", ref = "origin/myfeature") ``` where `myfeature` is the name of the branch. This report can now be inspected (a URL will be generated which may be emailed around), and after being merged, the report can be run on the production server with ```r -orderly::orderly_run_remote("report-a", remote = "production") +orderly1::orderly_run_remote("report-a", remote = "production") ``` We would recommend that on the production server only `master` be used. This can be enforced by adding `master_only: true` to the configuration as: @@ -191,7 +191,7 @@ remote: As soon as there are multiple archives, resolving dependencies becomes more challenging. If Alice has two reports that depend on each other, she might want to use the most recent versions on her machine, or the most recent versions *as seen by one of her remotes* as that is where the report will eventually be run. -To allow this, when running `orderly::orderly_run`, Alice can provide the argument `remote`, indicating which of her remotes she would like to use for dependency resolution. +To allow this, when running `orderly1::orderly_run`, Alice can provide the argument `remote`, indicating which of her remotes she would like to use for dependency resolution. Now, even if she has more recent copies of the dependencies locally, her report will use the same copies as would be used on the server she chooses. Any local copies of remote reports will be downloaded to her computer before the report is run. diff --git a/vignettes/remote.Rmd b/vignettes/remote.Rmd index 505ac1845..a6659d8bc 100644 --- a/vignettes/remote.Rmd +++ b/vignettes/remote.Rmd @@ -59,9 +59,9 @@ where `$GITHUB_TOKEN` is an environment variable that holds a [GitHub token](htt Several commands can interact with the remote server: -* `orderly::orderly_run_remote` will run a report on a remote server, committing it immediately. This will save the log alongside the report. -* `orderly::orderly_pull_archive` will pull a version of a report from a remote server -* `orderly::orderly_pull_dependencies` will pull all the dependencies of a report from the remote server (i.e., versions of reports declared in the `depends:` section of a report) +* `orderly1::orderly_run_remote` will run a report on a remote server, committing it immediately. This will save the log alongside the report. +* `orderly1::orderly_pull_archive` will pull a version of a report from a remote server +* `orderly1::orderly_pull_dependencies` will pull all the dependencies of a report from the remote server (i.e., versions of reports declared in the `depends:` section of a report) ## Future developments From debd195109f8f63860295cb6805eb000d0a362f5 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Tue, 4 Jul 2023 14:19:02 +0100 Subject: [PATCH 2/6] Also update testthat call --- tests/testthat.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat.R b/tests/testthat.R index dafcdabda..10173dcce 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,4 +1,4 @@ library(testthat) -library(orderly) +library(orderly1) -test_check("orderly") +test_check("orderly1") From 1c00e5afe2d6266bef3775121f1fc85a374288b6 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Tue, 4 Jul 2023 14:23:57 +0100 Subject: [PATCH 3/6] More package name fixes --- R/config.R | 4 ++-- R/db2.R | 2 +- R/remote.R | 2 +- R/util.R | 2 +- R/zzz.R | 2 +- man/orderly_pull_dependencies.Rd | 2 +- reference/create-reference.R | 2 +- tests/testthat/test-config.R | 3 ++- tests/testthat/test-testing.R | 2 +- vignettes/orderly.Rmd | 2 +- 10 files changed, 12 insertions(+), 11 deletions(-) diff --git a/R/config.R b/R/config.R index 46c08cf53..5d7047a90 100644 --- a/R/config.R +++ b/R/config.R @@ -86,10 +86,10 @@ orderly_config_ <- R6::R6Class( self$raw <- yaml_read(filename) v <- self$raw$minimum_orderly_version - if (!is.null(v) && utils::packageVersion("orderly") < v) { + if (!is.null(v) && utils::packageVersion("orderly1") < v) { stop(sprintf( "Orderly version '%s' is required, but only '%s' installed", - v, utils::packageVersion("orderly"))) + v, utils::packageVersion("orderly1"))) } if (validate) { diff --git a/R/db2.R b/R/db2.R index 508aea7ce..7a40961fd 100644 --- a/R/db2.R +++ b/R/db2.R @@ -79,7 +79,7 @@ report_db_schema_read <- function(fields = NULL, dialect = "sqlite") { } else if (x$name == "orderly_schema") { x$values <- data_frame( schema_version = orderly_schema_version, - orderly_version = as.character(utils::packageVersion("orderly")), + orderly_version = as.character(utils::packageVersion("orderly1")), created = Sys.time()) } else if (x$name == "orderly_schema_tables") { x$values <- data_frame(name = names(d)) diff --git a/R/remote.R b/R/remote.R index b6313bb34..deb50fd7c 100644 --- a/R/remote.R +++ b/R/remote.R @@ -73,7 +73,7 @@ ##' remote interface for orderly repositories at a local path. See ##' also [OrderlyWeb](https://github.com/vimc/orderly-web) for a ##' system for hosting orderly repositories over an HTTP API. -##' `vignette("remote", package = "orderly")` describes the +##' `vignette("remote", package = "orderly1")` describes the ##' remote system in more detail. ##' ##' @example man-roxygen/example-remote.R diff --git a/R/util.R b/R/util.R index 3f14af0fd..0dbbc4490 100644 --- a/R/util.R +++ b/R/util.R @@ -75,7 +75,7 @@ find_file_descend <- function(target, start = ".", limit = "/") { } orderly_file <- function(...) { - system.file(..., package = "orderly", mustWork = TRUE) + system.file(..., package = "orderly1", mustWork = TRUE) } `%||%` <- function(a, b) { # nolint diff --git a/R/zzz.R b/R/zzz.R index 0ffc430e9..dca29a997 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -4,7 +4,7 @@ cache <- new.env(parent = emptyenv()) .onLoad <- function(...) { # nolint migrations <- package_version(names(available_migrations())) cache$current_archive_version <- - utils::tail(migrations[migrations <= utils::packageVersion("orderly")], 1L) + utils::tail(migrations[migrations <= utils::packageVersion("orderly1")], 1L) cache$default_remote <- list() cache$remotes <- list() cache$schema <- list() diff --git a/man/orderly_pull_dependencies.Rd b/man/orderly_pull_dependencies.Rd index f80454a1a..df5367747 100644 --- a/man/orderly_pull_dependencies.Rd +++ b/man/orderly_pull_dependencies.Rd @@ -166,6 +166,6 @@ orderly1::orderly_list_archive(root = path_local) remote interface for orderly repositories at a local path. See also \href{https://github.com/vimc/orderly-web}{OrderlyWeb} for a system for hosting orderly repositories over an HTTP API. -\code{vignette("remote", package = "orderly")} describes the +\code{vignette("remote", package = "orderly1")} describes the remote system in more detail. } diff --git a/reference/create-reference.R b/reference/create-reference.R index 5442228cd..5fa26dbb4 100644 --- a/reference/create-reference.R +++ b/reference/create-reference.R @@ -1,6 +1,6 @@ devtools::load_all() -stopifnot(packageVersion("orderly") == "0.4.8") +stopifnot(packageVersion("orderly1") == "0.4.8") unlink("reference/0.4.8", recursive = TRUE) unlink("reference/0.3.2", recursive = TRUE) unlink("reference/0.3.2.zip") diff --git a/tests/testthat/test-config.R b/tests/testthat/test-config.R index f6a88e01e..a64383020 100644 --- a/tests/testthat/test-config.R +++ b/tests/testthat/test-config.R @@ -111,7 +111,8 @@ test_that("minimum version is a less than relationship", { path <- tempfile() dir.create(path) - dat <- list(minimum_orderly_version = as.character(packageVersion("orderly"))) + dat <- list( + minimum_orderly_version = as.character(packageVersion("orderly1"))) writeLines(yaml::as.yaml(dat), path_orderly_config_yml(path)) cfg <- orderly_config_$new(path) expect_is(cfg, "orderly_config") diff --git a/tests/testthat/test-testing.R b/tests/testthat/test-testing.R index 1f7eac95e..824068299 100644 --- a/tests/testthat/test-testing.R +++ b/tests/testthat/test-testing.R @@ -23,7 +23,7 @@ test_that("can create an orderly git repo from given source", { path <- tempfile() dir.create(path) on.exit(unlink(path, recursive = TRUE)) - source <- system.file("examples/demo", package = "orderly") + source <- system.file("examples/demo", package = "orderly1") prepare_git_example_from_source(source, path) expect_true(file.exists(file.path(path, ".git"))) expect_true(dir.exists(file.path(path, "archive"))) diff --git a/vignettes/orderly.Rmd b/vignettes/orderly.Rmd index ef4f98154..ed784c73b 100644 --- a/vignettes/orderly.Rmd +++ b/vignettes/orderly.Rmd @@ -17,7 +17,7 @@ r_output <- function(x) lang_output(x, "r") yaml_output <- function(x) lang_output(x, "yaml") plain_output <- function(x) lang_output(x, "plain") orderly_file <- function(...) { - system.file(..., package = "orderly", mustWork = TRUE) + system.file(..., package = "orderly1", mustWork = TRUE) } path <- orderly1:::prepare_orderly_example("nodata") From 317f1dec884e32a7d6d600dc493df39f201e7395 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Tue, 4 Jul 2023 14:33:31 +0100 Subject: [PATCH 4/6] Fix lint --- R/helpers.R | 3 ++- man/orderly_use.Rd | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/R/helpers.R b/R/helpers.R index 668c8a65e..c2ec93e52 100644 --- a/R/helpers.R +++ b/R/helpers.R @@ -48,7 +48,8 @@ ##' orderly1::orderly_use_resource("mtcars.csv", "example", path, edit = FALSE) ##' ##' # Modify the orderly.yml file within src/example: -##' orderly1::orderly_use_resource("mtcars.csv", "example", path, prompt = FALSE) +##' orderly1::orderly_use_resource("mtcars.csv", "example", path, +##' prompt = FALSE) ##' ##' # The result is a file that now has a 'resources' section ##' # containing our new file diff --git a/man/orderly_use.Rd b/man/orderly_use.Rd index 21418be9d..7e3038661 100644 --- a/man/orderly_use.Rd +++ b/man/orderly_use.Rd @@ -105,7 +105,8 @@ write.csv(mtcars, file.path(path, "src", "example", "mtcars.csv"), orderly1::orderly_use_resource("mtcars.csv", "example", path, edit = FALSE) # Modify the orderly.yml file within src/example: -orderly1::orderly_use_resource("mtcars.csv", "example", path, prompt = FALSE) +orderly1::orderly_use_resource("mtcars.csv", "example", path, + prompt = FALSE) # The result is a file that now has a 'resources' section # containing our new file From 6cfa9fb3e1e9efe82913a298f522107496b968c7 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Tue, 4 Jul 2023 14:37:13 +0100 Subject: [PATCH 5/6] Bump workflow version --- .github/workflows/R-CMD-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 33792206e..e07981ae3 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -38,7 +38,7 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} From d3ce89123392d755eeab3cc30150b53dca4949f3 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Tue, 4 Jul 2023 14:41:53 +0100 Subject: [PATCH 6/6] Update workflow --- .github/workflows/test-coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index bef1f30c8..f6a192706 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -21,7 +21,7 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 - uses: r-lib/actions/setup-pandoc@v1