Skip to content

Commit

Permalink
Fix checks
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau committed Apr 10, 2024
1 parent 3082d40 commit 3a5220b
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 15 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ Encoding: UTF-8
Language: en-US
Config/testthat/edition: 3
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.0
RoxygenNote: 7.3.1
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ importFrom(utils,globalVariables)
importFrom(vctrs,vec_rbind)
importFrom(xml2,as_list)
importFrom(xml2,xml_find_all)
importFrom(yaml,read_yaml)
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# crew.cluster 0.3.0.9000

* Add a "monitor" class for SLURM clusters.
* Add a monitor class for SLURM clusters.

# crew.cluster 0.3.0

Expand Down
20 changes: 12 additions & 8 deletions R/crew_monitor_slurm.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ crew_class_monitor_slurm <- R6::R6Class(
cloneable = FALSE,
public = list(
#' @description List SLURM jobs.
#'
#' This function loads the entire SLURM queue for all users, so it may take
#' several seconds to execute. It is intended for interactive use, and
#' should especially be avoided in scripts where it is called frequently.
#' It requires SLURM version 20.02 or higher, along with the YAML plugin.
#' @details This function loads the entire SLURM queue for all users,
#' so it may take several seconds to execute.
#' It is intended for interactive use, and
#' should especially be avoided in scripts where it is called
#' frequently. It requires SLURM version 20.02 or higher,
#' along with the YAML plugin.
#' @return A `tibble` with one row per SLURM job and columns with
#' specific details.
#' @param user Character of length 1, user name of the jobs to list.
Expand Down Expand Up @@ -64,14 +65,17 @@ crew_class_monitor_slurm <- R6::R6Class(
c(
map(.x[monitor_cols], ~ unlist(.x) %||% NA),
list(
nodes = paste(unlist(.x$job_resources$nodes), collapse = ",") %||% NA
nodes = paste(
unlist(.x$job_resources$nodes),
collapse = ","
) %||% NA
)
)
)
)
out <- do.call(vctrs::vec_rbind, out)
out <- out[out$user_name == user,]
out <- out[which(out$job_state != "CANCELLED"),]
out <- out[out$user_name == user, ]
out <- out[which(out$job_state != "CANCELLED"), ]
out$job_id <- as.character(out$job_id)
out$start_time <- as.POSIXct(out$start_time, origin = "1970-01-01")
out
Expand Down
1 change: 1 addition & 0 deletions R/crew_package.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#' @importFrom vctrs vec_rbind
#' @importFrom utils globalVariables
#' @importFrom xml2 as_list xml_find_all
#' @importFrom yaml read_yaml
NULL

utils::globalVariables(".")
2 changes: 2 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ reference:
- 'crew_controller_slurm'
- 'crew_launcher_slurm'
- 'crew_class_launcher_slurm'
- 'crew_monitor_slurm'
- 'crew_class_monitor_slurm'
14 changes: 9 additions & 5 deletions man/crew_class_monitor_slurm.Rd

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

0 comments on commit 3a5220b

Please sign in to comment.