[Rcpp-commits] r4267 - in pkg/RcppCNPy: . man tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Feb 21 03:20:07 CET 2013


Author: edd
Date: 2013-02-21 03:20:05 +0100 (Thu, 21 Feb 2013)
New Revision: 4267

Modified:
   pkg/RcppCNPy/ChangeLog
   pkg/RcppCNPy/DESCRIPTION
   pkg/RcppCNPy/man/RcppCNPy-package.Rd
   pkg/RcppCNPy/tests/loadFiles.R
Log:
more integer support


Modified: pkg/RcppCNPy/ChangeLog
===================================================================
--- pkg/RcppCNPy/ChangeLog	2013-02-21 02:08:02 UTC (rev 4266)
+++ pkg/RcppCNPy/ChangeLog	2013-02-21 02:20:05 UTC (rev 4267)
@@ -2,7 +2,11 @@
 
 	* src/cnpyMod.cpp (npyHasIntegerSupport): New function to test if
 	integer support was compiled in, also exported via Rcpp Modules to R
+	* man/RcppCNPy-package.Rd: Added documentation entry
 
+	* tests/loadFiles.R: Updated regression test to use run-time integer
+	support check, and test integer support if available
+
 2013-02-19  Dirk Eddelbuettel  <edd at debian.org>
 
 	* src/cnpy.h: Define R_NO_REMAP before including Rinternals to not

Modified: pkg/RcppCNPy/DESCRIPTION
===================================================================
--- pkg/RcppCNPy/DESCRIPTION	2013-02-21 02:08:02 UTC (rev 4266)
+++ pkg/RcppCNPy/DESCRIPTION	2013-02-21 02:20:05 UTC (rev 4267)
@@ -1,7 +1,7 @@
 Package: RcppCNPy
 Type: Package
 Title: Rcpp bindings for NumPy files
-Version: 0.2.0.1
+Version: 0.2.0.2
 Date: $Date$
 Author: Dirk Eddelbuettel
 Maintainer: Dirk Eddelbuettel <edd at debian.org>

Modified: pkg/RcppCNPy/man/RcppCNPy-package.Rd
===================================================================
--- pkg/RcppCNPy/man/RcppCNPy-package.Rd	2013-02-21 02:08:02 UTC (rev 4266)
+++ pkg/RcppCNPy/man/RcppCNPy-package.Rd	2013-02-21 02:20:05 UTC (rev 4267)
@@ -3,6 +3,7 @@
 \alias{RcppCNPy}
 \alias{npyLoad}
 \alias{npySave}
+\alias{npyHasIntegerSupport}
 \docType{package}
 \title{
   File access to data files written by (or for) NumPy (Numeric Python) modules
@@ -23,6 +24,7 @@
 \usage{
   npyLoad(filename, type="numeric", dotranspose=TRUE)
   npySave(filename, object, mode="w")
+  npyHasIntegerSupport()
 }
 \arguments{
   \item{filename}{string with (path and) filename for a \code{npy}
@@ -43,14 +45,6 @@
   }
 }
 \details{
-  \tabular{ll}{
-    Package: \tab RcppCNPy\cr
-    Type: \tab Package\cr
-    Version: \tab 0.1.0\cr
-    Date: \tab 2012-07-07\cr
-    License: \tab GPL (>= 2)\cr
-  }
-
   The package uses Rcpp modules to provide R bindings \code{npyLoad()}
   and \code{npySave()} which wrap the \code{npy_load()} and
   \code{npy_save()} functions. Currently, only one- and two-dimensional

Modified: pkg/RcppCNPy/tests/loadFiles.R
===================================================================
--- pkg/RcppCNPy/tests/loadFiles.R	2013-02-21 02:08:02 UTC (rev 4266)
+++ pkg/RcppCNPy/tests/loadFiles.R	2013-02-21 02:20:05 UTC (rev 4267)
@@ -10,15 +10,19 @@
 fmat
 stopifnot(all.equal(fmat, t(matrix(seq(0,11) * 1.1, 4, 3))))
 
-#imat <- npyLoad("imat.npy", "integer")
-#imat
-#stopifnot(all.equal(imat, t(matrix(seq(0,11), 4, 3))))
+if (npyHasIntegerSupport()) {
+    imat <- npyLoad("imat.npy", "integer")
+    imat
+    stopifnot(all.equal(imat, t(matrix(seq(0,11), 4, 3))))
+}
 
 fvec <- npyLoad("fvec.npy")
 fvec
 stopifnot(all.equal(fvec, seq(0,4) * 1.1))
 
-#ivec <- npyLoad("ivec.npy", "integer")
-#ivec
-#stopifnot(all.equal(ivec, seq(0,4)))
+if (npyHasIntegerSupport()) {
+    ivec <- npyLoad("ivec.npy", "integer")
+    ivec
+    stopifnot(all.equal(ivec, seq(0,4)))
+}
 



More information about the Rcpp-commits mailing list