Skip to content

Commit

Permalink
Style code and rebuild man page
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-Eagles committed Sep 29, 2023
1 parent 69f41e4 commit e7bacaa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion R/job_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' @examples
#'
#' # Must be run in a SLURM environment where a 'shared' partition exists
#' if (system('which sbatch') == 0) {
#' if (system("which sbatch") == 0) {
#' job_df <- job_info(partition = "shared")
#'
#' # Sum up requested CPUs across all running jobs
Expand Down
11 changes: 6 additions & 5 deletions R/job_single.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@
#' ## 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) {
## Remove any spaces
name <- gsub(" ", "_", name)

Expand Down Expand Up @@ -89,7 +90,7 @@ job_single <- function(name, create_shell = FALSE, partition = "shared", memory
}
cores <- as.integer(cores)

if (!grepl('^[1-9][0-9]*[KMGT]$', memory)) {
if (!grepl("^[1-9][0-9]*[KMGT]$", memory)) {
stop(
"Could not parse memory request. Must be a character containing a positive integer and units 'K', 'M', 'G', or 'T'.",
call. = FALSE
Expand Down
2 changes: 1 addition & 1 deletion man/job_info.Rd

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

0 comments on commit e7bacaa

Please sign in to comment.