[CHNOSZ-commits] r61 - in pkg/CHNOSZ: . R inst inst/tests man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jan 11 05:28:51 CET 2014


Author: jedick
Date: 2014-01-11 05:28:50 +0100 (Sat, 11 Jan 2014)
New Revision: 61

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/NAMESPACE
   pkg/CHNOSZ/R/util.affinity.R
   pkg/CHNOSZ/inst/NEWS
   pkg/CHNOSZ/inst/tests/test-ionize.aa.R
   pkg/CHNOSZ/inst/tests/test-thermo.R
   pkg/CHNOSZ/man/CHNOSZ-package.Rd
Log:
update tests for development version of testthat


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2014-01-09 12:25:40 UTC (rev 60)
+++ pkg/CHNOSZ/DESCRIPTION	2014-01-11 04:28:50 UTC (rev 61)
@@ -1,10 +1,10 @@
-Date: 2013-12-15
+Date: 2014-01-11
 Package: CHNOSZ
-Version: 1.0.2-2
+Version: 1.0.2-3
 Title: Chemical Thermodynamics and Activity Diagrams
-Author: Jeffrey M. Dick
+Author: Jeffrey Dick
 Maintainer: Jeffrey Dick <j3ffdick at gmail.com>
-Depends: R (>= 2.12.0), utils
+Depends: R (>= 2.12.0)
 Suggests: limSolve, parallel, testthat
 Description: This package includes functions and data sets to support chemical thermodynamic 
   modeling in biochemistry and low-temperature geochemistry. The features include calculation

Modified: pkg/CHNOSZ/NAMESPACE
===================================================================
--- pkg/CHNOSZ/NAMESPACE	2014-01-09 12:25:40 UTC (rev 60)
+++ pkg/CHNOSZ/NAMESPACE	2014-01-11 04:28:50 UTC (rev 61)
@@ -1,13 +1,5 @@
-# modified from
-# Default NAMESPACE created by R
-
 # Export all names
 exportPattern(".")
 
-# Import all packages listed as Imports or Depends
-import(
-  utils
-)
-
 # Load shared objects
 useDynLib(CHNOSZ)

Modified: pkg/CHNOSZ/R/util.affinity.R
===================================================================
--- pkg/CHNOSZ/R/util.affinity.R	2014-01-09 12:25:40 UTC (rev 60)
+++ pkg/CHNOSZ/R/util.affinity.R	2014-01-11 04:28:50 UTC (rev 61)
@@ -389,7 +389,9 @@
     # make a grid of all combinations
     # put T, P, pH in same order as they show up vars
     egargs <- list(T=T, P=P, pH=pH)
-    TPpHorder <- order(c(iT, iP, iHplus))
+    # order(c(NA, NA, NA)) might segfault in some versions of R (seen in R 2.15.3 on Linux)
+    if(is.na(iT) & is.na(iP) & is.na(iHplus)) TPpHorder <- c(1, 2, 3)
+    else TPpHorder <- order(c(iT, iP, iHplus))
     egargs <- c(egargs[TPpHorder], list(stringsAsFactors=FALSE))
     TPpH <- do.call(expand.grid, egargs)
     # figure out the dimensions of T-P-pH (making sure to drop any that aren't in vars)

Modified: pkg/CHNOSZ/inst/NEWS
===================================================================
--- pkg/CHNOSZ/inst/NEWS	2014-01-09 12:25:40 UTC (rev 60)
+++ pkg/CHNOSZ/inst/NEWS	2014-01-11 04:28:50 UTC (rev 61)
@@ -1,35 +1,40 @@
-CHANGES IN CHNOSZ 1.0.2-2 (2013-12-17)
+CHANGES IN CHNOSZ 1.0.2-3 (2014-01-11)
 --------------------------------------
 
-- Updated extdata/protein/Sce.csv.xz using Saccharomyces Genome Database
-  protein_properties.tab and SGD_features.tab dated 2013-08-24.
+- Updated extdata/protein/Sce.csv.xz using Saccharomyces Genome
+  Database protein_properties.tab and SGD_features.tab dated
+  2013-08-24.
 
 - more.aa() includes SGDID and gene name in the abbrv and ref columns.
 
 - In extdata/refseq, scripts and data files were updated for NCBI
-  Reference Sequence (RefSeq) release 61 (2013-09-09). Code was adapted
-  to deal with WP multispecies accessions.
+  Reference Sequence (RefSeq) release 61 (2013-09-09). Code was
+  adapted to deal with WP multispecies accessions.
 
 - read.fasta() gets new argument 'id'; when supplied, it skips reading
   the protein names from the FASTA headers.
 
-- When reading protein names from the FASTA headers, read.fasta() stops
-  only at the first space, not space or underscore as before.
+- When reading protein names from the FASTA headers, read.fasta()
+  stops only at the first space, not space or underscore as before.
 
 - info() no longer specially sets state of "O2" or "oxygen" to gas.
 
-- In thermo$obigt, names of gases (e.g. "oxygen") are used only for the
-  gaseous species; names were removed from dissolved species in rows
-  63-79. Both gases and aqueous species can continue to be referenced by
-  their chemical formula.
+- In thermo$obigt, names of gases (e.g. "oxygen") are used only for
+  the gaseous species; names were removed from dissolved species in
+  rows 63-79. Both gases and aqueous species can continue to be
+  referenced by their chemical formulas.
 
 - In read.expr(), allow multiple filter specifications.
 
 - In revisit(), extend ranges of axes of scatter plots.
 
-- revisit() has new argument loga0, a single vector of base-10 logarithms of
-  species activities used to calculate the base-2 log ratio ( log2(a1/a0) ).
+- revisit() has new argument loga0, a single vector of base-10
+  logarithms of activities of species used to calculate the base-2 log
+  ratio ( log2(a1/a0) ).
 
+- Updated tests to be compatible with testthat version 0.8. Some tests
+  now check for e.g. errors *and* warnings produced by a single
+  function call.
 
 CHANGES IN CHNOSZ 1.0.1 (2013-07-04)
 ------------------------------------

Modified: pkg/CHNOSZ/inst/tests/test-ionize.aa.R
===================================================================
--- pkg/CHNOSZ/inst/tests/test-ionize.aa.R	2014-01-09 12:25:40 UTC (rev 60)
+++ pkg/CHNOSZ/inst/tests/test-ionize.aa.R	2014-01-11 04:28:50 UTC (rev 61)
@@ -1,7 +1,8 @@
 context("ionize.aa")
 
 test_that("handling of repeated T, P, pH values is correct", {
-  expect_message(ionize.aa(T=c(25, 25, 100, 100, 100), P=c(100, 1000, 1000, 1000, 1000)), "18 species at 3 values of T and P \\(wet\\)")
+  expect_message(expect_error(ionize.aa(T=c(25, 25, 100, 100, 100), P=c(100, 1000, 1000, 1000, 1000))),
+                              "18 species at 3 values of T and P \\(wet\\)")
   expect_message(ia.25x10 <- ionize.aa(T=rep(25,10), ret.val="pK"), "18 species at 298.15 K and 1 bar \\(wet\\)")
   # we have ten rows of the same values
   expect_identical(ia.25x10[1, ], apply(ia.25x10, 2, unique))

Modified: pkg/CHNOSZ/inst/tests/test-thermo.R
===================================================================
--- pkg/CHNOSZ/inst/tests/test-thermo.R	2014-01-09 12:25:40 UTC (rev 60)
+++ pkg/CHNOSZ/inst/tests/test-thermo.R	2014-01-11 04:28:50 UTC (rev 61)
@@ -26,7 +26,8 @@
   # we need at least a name and some property
   expect_error(mod.obigt("test"), "species name and a property")
   # a valid formula is needed
-  expect_warning(mod.obigt("test", date=today()), "please supply a valid chemical formula")
+  expect_warning(expect_error(mod.obigt("test", date=today()), "is not a simple chemical formula"),
+               "please supply a valid chemical formula")
   # the default state is aq
   expect_message(itest <- mod.obigt("test", formula="Z0", date=today()), "added test\\(aq\\)")
   # we should get NA values of G for a species with NA properties 

Modified: pkg/CHNOSZ/man/CHNOSZ-package.Rd
===================================================================
--- pkg/CHNOSZ/man/CHNOSZ-package.Rd	2014-01-09 12:25:40 UTC (rev 60)
+++ pkg/CHNOSZ/man/CHNOSZ-package.Rd	2014-01-11 04:28:50 UTC (rev 61)
@@ -56,11 +56,11 @@
 
 
 \section{Compatibility}{
-  The recommended version of \R is 2.14.0 or greater (to find vignettes in the \code{vignettes} directory).
-  The package depends on \R version 2.12.0 or greater (so useDynLib in the NAMESPACE can find the shared library on Windows).
-  Before version 0.9-9 of the package, the dependency was given as \R version 2.10.0 or greater (to read compressed data files).
+  The recommended version of \R is 2.14.0 or greater (to find vignettes in the \code{vignettes} directory, and for availability of \pkg{parallel} in the standard library).
+  As of version 0.9-9, the package depends on \R version 2.12.0 or greater (so useDynLib in the NAMESPACE can find the shared library on Windows).
+  Starting with version 0.9-6 of the package, the dependency was given as \R version 2.10.0 or greater (to read compressed data files).
   Before version 0.9-6 of the package, the dependency was given as \R version 2.7.0 or greater (major update of the X11 device in 2.7.0).
-  However, without accessing the compressed data files in \code{extdata} it should be possible to run CHNOSZ on Unix-alikes under \R versions 2.4.0 or greater (availability of the \samp{stringsAsFactors} argument of \code{\link{data.frame}}). 
+  Without accessing the compressed data files in \code{extdata} it should be possible to run CHNOSZ on Unix-alikes under \R versions 2.4.0 or greater (availability of the \samp{stringsAsFactors} argument of \code{\link{data.frame}}). 
 }
 
 \section{Acknowledgements}{



More information about the CHNOSZ-commits mailing list