Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename package from orderly to orderly1 #327

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions R/batch.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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) {
Expand Down
16 changes: 8 additions & 8 deletions R/bundle.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
22 changes: 11 additions & 11 deletions R/cleanup.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions R/config.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
24 changes: 12 additions & 12 deletions R/db.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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)
##'
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions R/db2.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)
}

Expand All @@ -175,15 +175,15 @@ 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)
}

tag <- DBI::dbReadTable(con, "tag")$id
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)
}
}
Expand Down
8 changes: 4 additions & 4 deletions R/deduplicate.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
24 changes: 12 additions & 12 deletions R/dependencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
16 changes: 8 additions & 8 deletions R/develop.R
Original file line number Diff line number Diff line change
Expand Up @@ -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:`.
##'
Expand All @@ -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.
Expand All @@ -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(),
Expand Down
Loading