[H5r-commits] r83 - inst/h5_files tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Aug 2 18:47:52 CEST 2012


Author: extemporaneousb
Date: 2012-08-02 18:47:52 +0200 (Thu, 02 Aug 2012)
New Revision: 83

Modified:
   inst/h5_files/ex_1.h5
   inst/h5_files/makeH5.py
   tests/testGetGroup.R
   tests/testRead.R
Log:
Shrunk test file by repacking. Shortened tests.



Modified: inst/h5_files/ex_1.h5
===================================================================
(Binary files differ)

Modified: inst/h5_files/makeH5.py
===================================================================
--- inst/h5_files/makeH5.py	2012-08-01 23:19:03 UTC (rev 82)
+++ inst/h5_files/makeH5.py	2012-08-02 16:47:52 UTC (rev 83)
@@ -54,5 +54,8 @@
 letterArray = array(['a', 'bb', 'ccc', 'dddd', 'eeeee', 'ffffff'])
 g.create_dataset("ds_11", data = letterArray.reshape((2, 3)))
 
+f.close()
 
-f.close()
+## shrink the file for submission.
+os.system("h5repack -v -f GZIP=7 %s %s-repacked" % (FILE, FILE))
+os.system("mv %s-repacked %s" % (FILE, FILE))

Modified: tests/testGetGroup.R
===================================================================
--- tests/testGetGroup.R	2012-08-01 23:19:03 UTC (rev 82)
+++ tests/testGetGroup.R	2012-08-02 16:47:52 UTC (rev 83)
@@ -7,8 +7,8 @@
 f <- H5File(file)
 
 gc()
-v <- replicate(100000, {
+v <- replicate(1000, {
   getH5Group(f, "group_1")
 })
 rm(v)
-lapply(1:10, function(i) gc())
+lapply(1:5, function(i) gc())

Modified: tests/testRead.R
===================================================================
--- tests/testRead.R	2012-08-01 23:19:03 UTC (rev 82)
+++ tests/testRead.R	2012-08-02 16:47:52 UTC (rev 83)
@@ -85,7 +85,7 @@
 
 TH("ds_2 dim", all(dim(ds4[,]) == dim(ds4)) & all(dim(ds4M[,]) == dim(ds4)))
 
-TH("ds_4, memory", (function(n = 100, s = 100) {
+TH("ds_4, memory", (function(n = 10, s = 10) {
   g1 <- gc()[,1]
   a <- replicate(n, {
     replicate(s, getH5Dataset(g, "ds_4", inMemory = FALSE)[1:2,1:2])
@@ -188,7 +188,7 @@
    all(ds8[] == ds8[ hSlab(c(1,1), end = dim(ds8)) ]))
 
 TH("normal time", {
-  all(replicate(10000, {
+  all(replicate(100, {
     m <- apply(cbind(c(1,1,1), dim(ds7)), 1, function(b) {
       a <- runif(1, b[1], b[2])
       floor(c(a, runif(1, a, b[2])))
@@ -201,7 +201,7 @@
 })
 
 TH("hSlab time", {
-  all(replicate(10000, {
+  all(replicate(100, {
     m <- apply(cbind(c(1,1,1), dim(ds7)), 1, function(b) {
       a <- runif(1, b[1], b[2])
       floor(c(a, runif(1, a, b[2])))



More information about the H5r-commits mailing list