Skip to content

Commit

Permalink
version 0.9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
mllg committed Sep 6, 2017
1 parent 85e6d3c commit b1aae05
Show file tree
Hide file tree
Showing 37 changed files with 328 additions and 291 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: batchtools
Title: Tools for Computation on Batch Systems
Version: 0.9.5-9000
Version: 0.9.6
Authors@R: c(
person("Michel", "Lang", NULL, "michellang@gmail.com", role = c("cre", "aut")),
person("Bernd", "Bischl", NULL, "bernd_bischl@gmx.de", role = "aut"),
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# batchtools 0.9.6

* Fixed a bug where the wrong problem was retrieved from the cache. This was only triggered for chunked jobs in
combination with an `ExperimentRegistry`.

# batchtools 0.9.5

* Added a missing routine to upgrade registries created with batchtools prior to v0.9.3.
Expand Down
26 changes: 18 additions & 8 deletions R/RDSReader.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,26 @@ RDSReader = R6Class("RDSReader",
self$use.cache = use.cache
},

get = function(uri, slot = NULL) {
get = function(uri, slot = NA_character_) {
read = function(uri) if (file.exists(uri)) readRDS(uri) else NULL
if (self$use.cache) {
nn = slot %??% uri
if (! nn %chin% names(self$cache))
self$cache[[nn]] = read(uri)
self$cache[[nn]]
} else {
read(uri)

# no cache used, read object from disk and return
if (!self$use.cache)
return(read(uri))

# not slotted:
# look up object in cache. If not found, add to cache. Return cached object
if (is.na(slot)) {
if (! uri %chin% names(self$cache))
self$cache[[uri]] = read(uri)
return(self$cache[[uri]])
}

# slotted:
# object is stored in cache[[slot]] as list(obj = [cached obj], uri = uri)
if (is.null(self$cache[[slot]]) || self$cache[[slot]]$uri != uri)
self$cache[[slot]] = list(obj = read(uri), uri = uri)
return(self$cache[[slot]]$obj)
},

clear = function() {
Expand Down
14 changes: 7 additions & 7 deletions docs/articles/batchtools.html

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

2 changes: 1 addition & 1 deletion docs/articles/index.html

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

8 changes: 8 additions & 0 deletions docs/news/index.html

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

2 changes: 1 addition & 1 deletion docs/reference/JobCollection.html

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

4 changes: 2 additions & 2 deletions docs/reference/JobExperiment.html

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

Loading

0 comments on commit b1aae05

Please sign in to comment.