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

Add function to return details of report script from parsed exprs #129

Merged
merged 8 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: orderly2
Title: Orderly Next Generation
Version: 1.99.12
Version: 1.99.13
Authors@R: c(person("Rich", "FitzJohn", role = c("aut", "cre"),
email = "[email protected]"),
person("Robert", "Ashton", role = "aut"),
Expand All @@ -11,7 +11,7 @@ Description: Reimplementation of orderly based on outpack.
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
URL: https://github.com/mrc-ide/orderly2
BugReports: https://github.com/mrc-ide/orderly2/issues
Imports:
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ S3method(format,orderly_query)
S3method(print,orderly_cleanup_status)
S3method(print,orderly_query_explain)
export(orderly_artefact)
export(orderly_build_script_details)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about calling it orderly_parse() and have it take arguments of either path or expr, then just documenting it as experts use? I can see this being generally useful really

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep I like that

export(orderly_cleanup)
export(orderly_cleanup_status)
export(orderly_config)
Expand Down
17 changes: 17 additions & 0 deletions R/read.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ orderly_read <- function(path, call = NULL) {

orderly_read_r <- function(path, entrypoint_filename) {
exprs <- parse(file = path)
orderly_build_script_details(exprs, entrypoint_filename)
}

#' Build the details of an orderly source script
#'
#' Takes the parsed AST from an orderly script, parses details
#' of any calls to orderly_ in-script functions into intermediate
#' representation for downstream use. Also validates calls to
#' orderly_ in-script functions are well-formed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#' orderly_ in-script functions are well-formed.
#' `orderly_*` in-script functions are well-formed.

#'
#' @param exprs Parsed AST from orderly script
#' @param entrypoint_filename Name of entrypoint file to include in metadata
#'
#' @return Details of orderly script
#' @export
#' @keywords internal
orderly_build_script_details <- function(exprs, entrypoint_filename) {

inputs <- list()
artefacts <- list()
Expand Down
23 changes: 23 additions & 0 deletions man/orderly_build_script_details.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading