From 93332291c83f4e0f937cfba48917b30caf4d12b9 Mon Sep 17 00:00:00 2001 From: Matt Smith Date: Wed, 6 Nov 2024 15:11:07 +0000 Subject: [PATCH 1/2] cleaned up onAttach message to options('...') (from option('...')) so users can copy paste for setting the options. --- R/attach.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/attach.R b/R/attach.R index 42ac2bc..10fde39 100644 --- a/R/attach.R +++ b/R/attach.R @@ -14,21 +14,21 @@ slurmtools_options_message <- function() { # Check for each used options tmpl_path <- getOption('slurmtools.slurm_job_template_path') if (is.null(tmpl_path)) { - unset_options <- c(unset_options, "option('slurmtools.slurm_job_template_path') is not set.") + unset_options <- c(unset_options, "options('slurmtools.slurm_job_template_path') is not set.") } else { set_options <- c(set_options, paste("slurmtools.slurm_jon_template_path:", tmpl_path)) } root <- getOption('slurmtools.submission_root') if (is.null(root)) { - unset_options <- c(unset_options, "option('slurmtools.submission_root') is not set.") + unset_options <- c(unset_options, "options('slurmtools.submission_root') is not set.") } else { set_options <- c(set_options, paste("slurmtools.submission_root:", root)) } bbi_config <- getOption("slurmtools.bbi_config_path") if (is.null(bbi_config)) { - unset_options <- c(unset_options, "option('slurmtools.bbi_config_path') is not set.") + unset_options <- c(unset_options, "options('slurmtools.bbi_config_path') is not set.") } else { set_options <- c(set_options, paste("slurmtools.bbi_config_path:", bbi_config)) } From 6380e8d6c62179ee78154f317cd3e721b6afb602 Mon Sep 17 00:00:00 2001 From: Matt Smith Date: Fri, 8 Nov 2024 15:47:45 +0000 Subject: [PATCH 2/2] renamed cancel_job to cancel_slurm_job to better align with package names --- DESCRIPTION | 2 +- NAMESPACE | 2 +- R/cancel-job.R | 2 +- R/slurmtools.R | 2 +- _pkgdown.yml | 2 +- man/{cancel_job.Rd => cancel_slurm_job.Rd} | 6 +++--- man/slurmtools.Rd | 2 +- vignettes/Running-nonmem.Rmd | 2 +- vignettes/custom-alerts.Rmd | 2 +- vignettes/slack-alerts.Rmd | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) rename man/{cancel_job.Rd => cancel_slurm_job.Rd} (77%) diff --git a/DESCRIPTION b/DESCRIPTION index 94c18cf..4ca9ad0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: slurmtools Title: slurm tooling -Version: 0.0.0.9002 +Version: 0.0.0.9003 Authors@R: c(person("Devin", "Pastoor", , "devin@a2-ai.com", role = c("aut", "cre")), person("Jenna", "Elwing", email = "jenna@a2-ai.com", role = "aut"), person("Matthew", "Smith", email = "matthews@a2-ai.com", role = "aut")) diff --git a/NAMESPACE b/NAMESPACE index e3e3ca0..5275fec 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -9,7 +9,7 @@ S3method(format_toml,integer) S3method(format_toml,list) S3method(format_toml,logical) S3method(format_toml,name) -export(cancel_job) +export(cancel_slurm_job) export(generate_nmm_config) export(get_slurm_jobs) export(get_slurm_partitions) diff --git a/R/cancel-job.R b/R/cancel-job.R index e0cccd0..62224fd 100644 --- a/R/cancel-job.R +++ b/R/cancel-job.R @@ -10,7 +10,7 @@ #' @examples \dontrun{ #' cancel_job(243) #' } -cancel_job <- function(job_id, user = NULL) { +cancel_slurm_job <- function(job_id, user = NULL) { current_user = if (is.null(Sys.getenv("USER"))) Sys.info()['user'] else Sys.getenv("USER") diff --git a/R/slurmtools.R b/R/slurmtools.R index c5fa31e..1058adf 100644 --- a/R/slurmtools.R +++ b/R/slurmtools.R @@ -18,7 +18,7 @@ #' #' @section cancelling jobs: #' \itemize{ -#' \item \code{\link{cancel_job}}: Cancels the specified job +#' \item \code{\link{cancel_slurm_job}}: Cancels the specified job #' } #' #' @section slurm partitions: diff --git a/_pkgdown.yml b/_pkgdown.yml index 2965e71..09f8f78 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -40,7 +40,7 @@ reference: - submit_nonmem_model - generate_nmm_config - get_slurm_jobs - - cancel_job + - cancel_slurm_job - get_slurm_partitions - slurmtools diff --git a/man/cancel_job.Rd b/man/cancel_slurm_job.Rd similarity index 77% rename from man/cancel_job.Rd rename to man/cancel_slurm_job.Rd index 8f584d6..bda3359 100644 --- a/man/cancel_job.Rd +++ b/man/cancel_slurm_job.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/cancel-job.R -\name{cancel_job} -\alias{cancel_job} +\name{cancel_slurm_job} +\alias{cancel_slurm_job} \title{Cancels a running job} \usage{ -cancel_job(job_id, user = NULL) +cancel_slurm_job(job_id, user = NULL) } \arguments{ \item{job_id}{job id to cancel} diff --git a/man/slurmtools.Rd b/man/slurmtools.Rd index b9836c0..f16c99e 100644 --- a/man/slurmtools.Rd +++ b/man/slurmtools.Rd @@ -29,7 +29,7 @@ that shows status and other information given with \code{squeue} \section{cancelling jobs}{ \itemize{ -\item \code{\link{cancel_job}}: Cancels the specified job +\item \code{\link{cancel_slurm_job}}: Cancels the specified job } } diff --git a/vignettes/Running-nonmem.Rmd b/vignettes/Running-nonmem.Rmd index 1e29ea6..f75a368 100644 --- a/vignettes/Running-nonmem.Rmd +++ b/vignettes/Running-nonmem.Rmd @@ -254,7 +254,7 @@ jobs <- get_slurm_jobs(user = "matthews") %>% dplyr::pull(job_id) for (job in jobs) { - cancel_job(job) + cancel_slurm_job(job) } unlink(file.path(nonmem, "1001"), recursive = TRUE) diff --git a/vignettes/custom-alerts.Rmd b/vignettes/custom-alerts.Rmd index 7fac863..b50320e 100644 --- a/vignettes/custom-alerts.Rmd +++ b/vignettes/custom-alerts.Rmd @@ -237,7 +237,7 @@ jobs <- get_slurm_jobs(user = "matthews") %>% dplyr::pull(job_id) for (job in jobs) { - cancel_job(job) + cancel_slurm_job(job) } unlink(file.path(nonmem, "1001"), recursive = TRUE) diff --git a/vignettes/slack-alerts.Rmd b/vignettes/slack-alerts.Rmd index 3917fec..1dfbe09 100644 --- a/vignettes/slack-alerts.Rmd +++ b/vignettes/slack-alerts.Rmd @@ -146,7 +146,7 @@ jobs <- get_slurm_jobs(user = "matthews") %>% dplyr::pull(job_id) for (job in jobs) { - cancel_job(job) + cancel_slurm_job(job) } unlink(file.path(nonmem, "1001"), recursive = TRUE)