Skip to content

Commit

Permalink
removed deprecated chunkIds
Browse files Browse the repository at this point in the history
  • Loading branch information
mllg committed May 24, 2018
1 parent f01e565 commit 478a6d0
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 148 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export(cfHandleUnknownSubmitError)
export(cfKillJob)
export(cfReadBrewTemplate)
export(chunk)
export(chunkIds)
export(clearRegistry)
export(doJobCollection)
export(estimateRuntimes)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# batchtools 0.9.11

* Removed deprecated function `chunkIds()`.

# batchtools 0.9.10

* Exported functions `findConfFile()` and `findTemplateFile()`.
Expand Down
39 changes: 1 addition & 38 deletions R/chunkIds.R
Original file line number Diff line number Diff line change
@@ -1,45 +1,8 @@
#' @title Chunk Jobs for Sequential Execution
#'
#' @description
#' This function is deprecated in favor of the more flexible \code{chunk}, \code{lpt} and \code{binpack}.
#'
#' @templateVar ids.default all
#' @template ids
#' @param group.by [\code{character(0)}]\cr
#' If \code{ids} is a \code{\link{data.frame}} with additional columns
#' (in addition to the required column \dQuote{job.id}), then the chunking is performed using
#' subgroups defined by the columns set in \code{group.by}.
#' See example.
#' @inheritParams chunk
#' @template reg
#' @return [\code{\link[data.table]{data.table}}] with columns \dQuote{job.id} and \dQuote{chunk}.
#' @seealso \code{\link{chunk}} \code{\link{binpack}} \code{\link{lpt}}
#' @export
chunkIds = function(ids = NULL, n.chunks = NULL, chunk.size = NULL, group.by = character(0L), reg = getDefaultRegistry()) {
.Deprecated("chunk", package = "batchtools")
assertRegistry(reg)
assertCharacter(group.by, any.missing = FALSE, min.chars = 1L)
ids = convertIds(reg, ids, default = allIds(reg), keep.extra = group.by)

if (length(group.by) > 0L) {
job.id = NULL
if (any(group.by %chnin% names(ids)))
stop("All columns to group by must be provided in the 'ids' table")
ids[, "chunk" := chunk(job.id, n.chunks = n.chunks, chunk.size = chunk.size), by = group.by]
ids[, "chunk" := .GRP, by = c(group.by, "chunk")]
} else {
ids[, "chunk" := chunk(job.id, n.chunks = n.chunks, chunk.size = chunk.size)]
}

return(ids[, c("job.id", "chunk")])
}


#' @title Chunk Jobs for Sequential Execution
#'
#' @description
#' Jobs can be partitioned into \dQuote{chunks} to be executed sequentially on the computational nodes.
#' Chunks are defined by providing a data frame with columns \dQuote{job.id} and \dQuote{chunk} (integer).
#' Chunks are defined by providing a data frame with columns \dQuote{job.id} and \dQuote{chunk} (integer)
#' to \code{\link{submitJobs}}.
#' All jobs with the same chunk number will be grouped together on one node to form a single
#' computational job.
Expand Down
11 changes: 1 addition & 10 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,13 @@
#' @importFrom withr with_dir with_seed local_options local_dir
"_PACKAGE"

#' @title Deprecated function in the batchtools package
#' @rdname batchtools-deprecated
#' @name batchtools-deprecated
#' @description
#' The following functions have been deprecated:
#' \tabular{rl}{
#' \code{chunkIds} \tab deprecated in favor of \code{\link{chunk}}, \code{\link{lpt}} and \code{\link{binpack}}\cr
#' }
NULL

batchtools = new.env(parent = emptyenv())
batchtools$debug = FALSE
batchtools$hooks = list(
remote = c("pre.do.collection", "post.do.collection"),
local = c("pre.sync", "post.sync", "pre.submit.job", "post.submit.job", "pre.submit", "post.submit", "pre.kill", "post.kill")
)

batchtools$resources = list(
per.job = c("walltime", "memory", "ncpus", "omp.threads", "blas.threads"),
per.chunk = c("measure.memory", "chunks.as.arrayjobs", "pm.backend", "foreach.backend")
Expand Down
11 changes: 0 additions & 11 deletions man/batchtools-deprecated.Rd

This file was deleted.

2 changes: 1 addition & 1 deletion man/chunk.Rd

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

48 changes: 0 additions & 48 deletions man/chunkIds.Rd

This file was deleted.

39 changes: 0 additions & 39 deletions tests/testthat/test_chunkIds.R

This file was deleted.

0 comments on commit 478a6d0

Please sign in to comment.