Skip to content

Commit b1aae05

Browse files
committed
version 0.9.6
1 parent 85e6d3c commit b1aae05

37 files changed

+328
-291
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: batchtools
22
Title: Tools for Computation on Batch Systems
3-
Version: 0.9.5-9000
3+
Version: 0.9.6
44
Authors@R: c(
55
person("Michel", "Lang", NULL, "[email protected]", role = c("cre", "aut")),
66
person("Bernd", "Bischl", NULL, "[email protected]", role = "aut"),

NEWS.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# batchtools 0.9.6
2+
3+
* Fixed a bug where the wrong problem was retrieved from the cache. This was only triggered for chunked jobs in
4+
combination with an `ExperimentRegistry`.
5+
16
# batchtools 0.9.5
27

38
* Added a missing routine to upgrade registries created with batchtools prior to v0.9.3.

R/RDSReader.R

+18-8
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,26 @@ RDSReader = R6Class("RDSReader",
88
self$use.cache = use.cache
99
},
1010

11-
get = function(uri, slot = NULL) {
11+
get = function(uri, slot = NA_character_) {
1212
read = function(uri) if (file.exists(uri)) readRDS(uri) else NULL
13-
if (self$use.cache) {
14-
nn = slot %??% uri
15-
if (! nn %chin% names(self$cache))
16-
self$cache[[nn]] = read(uri)
17-
self$cache[[nn]]
18-
} else {
19-
read(uri)
13+
14+
# no cache used, read object from disk and return
15+
if (!self$use.cache)
16+
return(read(uri))
17+
18+
# not slotted:
19+
# look up object in cache. If not found, add to cache. Return cached object
20+
if (is.na(slot)) {
21+
if (! uri %chin% names(self$cache))
22+
self$cache[[uri]] = read(uri)
23+
return(self$cache[[uri]])
2024
}
25+
26+
# slotted:
27+
# object is stored in cache[[slot]] as list(obj = [cached obj], uri = uri)
28+
if (is.null(self$cache[[slot]]) || self$cache[[slot]]$uri != uri)
29+
self$cache[[slot]] = list(obj = read(uri), uri = uri)
30+
return(self$cache[[slot]]$obj)
2131
},
2232

2333
clear = function() {

docs/articles/batchtools.html

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/articles/index.html

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/news/index.html

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/JobCollection.html

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/JobExperiment.html

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)