[H5r-commits] r25 - R inst tests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat May 22 01:21:54 CEST 2010
Author: extemporaneousb
Date: 2010-05-22 01:21:54 +0200 (Sat, 22 May 2010)
New Revision: 25
Added:
inst/makeBigH5.py
inst/performance.R
Modified:
R/h5R.R
tests/.Rhistory
Log:
Modified: R/h5R.R
===================================================================
--- R/h5R.R 2010-05-15 00:17:37 UTC (rev 24)
+++ R/h5R.R 2010-05-21 23:21:54 UTC (rev 25)
@@ -349,6 +349,7 @@
list(name = a[[1]], type = a[[2]], attributes = .listH5Attributes(h5Obj), dim = dim)
})
class(lst) <- "H5ContentList"
+ names(lst) <- sapply(lst, "[[", 1)
return(lst)
}
Added: inst/makeBigH5.py
===================================================================
--- inst/makeBigH5.py (rev 0)
+++ inst/makeBigH5.py 2010-05-21 23:21:54 UTC (rev 25)
@@ -0,0 +1,18 @@
+from h5py import *
+from numpy import *
+
+h5 = File("big.h5")
+x = random.randint(0, 1e5, 1e9)
+
+## with chunks.
+h5.create_dataset("cdata", data = x, chunks = (10000,))
+
+## without
+h5.create_dataset("udata", data = x)
+
+## zipped
+h5.create_dataset("zdata", data = x, compression = 'gzip')
+
+h5.close()
+
+
Added: inst/performance.R
===================================================================
--- inst/performance.R (rev 0)
+++ inst/performance.R 2010-05-21 23:21:54 UTC (rev 25)
@@ -0,0 +1,33 @@
+##
+## Investigate performance profiles of various access patterns.
+##
+
+require(h5r)
+
+
+h5 <- H5File("big.h5")
+
+cD <- getH5Dataset(h5, "cdata", inMemory = FALSE)
+uD <- getH5Dataset(h5, "udata", inMemory = FALSE)
+zD <- getH5Dataset(h5, "zdata", inMemory = FALSE)
+
+f <- function(d, N = 1000, mu = 1000) {
+ start <- runif(N, 1, length(d))
+ end <- start + round(rexp(N, 1/mu))
+ mapply(function(s,e) {
+ z <- d[s:e]
+ }, start, end)
+ 1
+}
+
+boxplot(as.data.frame(do.call(rbind, sapply(1:10, function(i) {
+ set.seed(i)
+ cT <- system.time(f(cD))[3]
+ uT <- system.time(f(uD))[3]
+ zD <- system.time(f(zD))[3]
+ list(cT, uT, zD)
+}))))
+
+
+
+
Modified: tests/.Rhistory
===================================================================
--- tests/.Rhistory 2010-05-15 00:17:37 UTC (rev 24)
+++ tests/.Rhistory 2010-05-21 23:21:54 UTC (rev 25)
@@ -1,28 +1,3 @@
-s[]
-s
-q()
-n
-listH5Contents(g)
-ds8
-c(1,2,3)[-1]
-! TRUE && 2 = 1
-(! TRUE) && 2 = 1
-(! TRUE) && 2
-(! TRUE) && x
-?"&&"
-(! TRUE) && (3/0)
-3/0
-(! TRUE) && (2/bbb)
-(! TRUE) && ncol(fdds)
-! TRUE && (3/0)
-! TRUE && ncol(sdff)
-if (! TRUE && ncol(sdff))
-3
-debug(.marginCheck)
-n
-n
-n
-i
Q
traceback()
debug(.marginCheck)
@@ -148,3 +123,28 @@
source("/home/NANOFLUIDICS/jbullard/projects/software/R/common/h5r/tests/testall.R")
TH(action="throw")
TH(action="print")
+ds1
+head(ds1)
+head
+colnames
+?colnames
+myExample(c(1,3,4))
+myExample(c(1,3,4))
+dim
+getMethod(dim)
+getMethods(dim)
+findMethod(dim)
+findMethods(dim)
+)
+dim(m)
+traceback()
+n
+n
+e
+n
+n
+findMethods("[")
+showMethods("[")
+showMethods("[", "nonStructure")
+showMethod("[", "nonStructure")
+getMethod("[", "nonStructure")
More information about the H5r-commits
mailing list