Skip to content

Commit

Permalink
Add documentation for a missing parameter; fix reference to 'parse_fi…
Browse files Browse the repository at this point in the history
…le_or_name' in example
  • Loading branch information
Nick-Eagles committed Nov 28, 2023
1 parent 47bf5d7 commit 3ba5dd3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
5 changes: 2 additions & 3 deletions R/job_loop.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
#' cores = 2
#' )
#'
job_loop <- function(
loops, name, create_shell = FALSE, partition = "shared", memory = "10G",
cores = 1L, tc = 20, email = "ALL", logdir = "logs") {
job_loop <- function(loops, name, create_shell = FALSE, partition = "shared", memory = "10G",
cores = 1L, tc = 20, email = "ALL", logdir = "logs") {
## Check that the loops are correctly defined
if (!is.list(loops)) {
stop("'loops' should be a named list.", call. = FALSE)
Expand Down
9 changes: 4 additions & 5 deletions R/job_single.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@
#' ## An array job
#' job_single("jhpce_job_array", task_num = 20, create_logdir = FALSE)
#'
job_single <- function(
name, create_shell = FALSE, partition = "shared", memory = "10G",
cores = 1L, email = "ALL", logdir = "logs", task_num = NULL, tc = 20,
command = 'Rscript -e "options(width = 120); sessioninfo::session_info()"',
create_logdir = TRUE) {
job_single <- function(name, create_shell = FALSE, partition = "shared", memory = "10G",
cores = 1L, email = "ALL", logdir = "logs", task_num = NULL, tc = 20,
command = 'Rscript -e "options(width = 120); sessioninfo::session_info()"',
create_logdir = TRUE) {
# Grab the path to the shell script, and the shell script's name,
# respectively
sh_file <- parse_file_or_name(name, should_exist = FALSE, r_ok = FALSE)
Expand Down
3 changes: 2 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ parse_slurm_time <- function(tim) {
#' (relative or absolute) to the shell or R script to create
#' @param should_exist A \code{logical(1)} vector. If TRUE, the specified script
#' must already exist; if FALSE, it must not exist
#' @param r_ok A \code{logical(1)} vector. If TRUE, \code{name} may end in '.R'
#'
#' @return A \code{character(1)} giving the absolute or relative path to the
#' shell script
Expand All @@ -185,7 +186,7 @@ parse_slurm_time <- function(tim) {
#' "my_script"
#' )
#' returned_scripts <- sapply(
#' acceptable_names, parse_file_or_name,
#' acceptable_names, slurmjobs:::parse_file_or_name,
#' should_exist = FALSE
#' )
#' print(returned_scripts)
Expand Down
4 changes: 3 additions & 1 deletion man/parse_file_or_name.Rd

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

0 comments on commit 3ba5dd3

Please sign in to comment.