[CHNOSZ-commits] r543 - in pkg/CHNOSZ: . R inst man tests/testthat vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jul 4 09:08:01 CEST 2020


Author: jedick
Date: 2020-07-04 09:08:01 +0200 (Sat, 04 Jul 2020)
New Revision: 543

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/NAMESPACE
   pkg/CHNOSZ/R/subcrt.R
   pkg/CHNOSZ/R/util.data.R
   pkg/CHNOSZ/inst/CHECKLIST
   pkg/CHNOSZ/inst/NEWS
   pkg/CHNOSZ/man/thermo.Rd
   pkg/CHNOSZ/tests/testthat/test-ionize.aa.R
   pkg/CHNOSZ/vignettes/anintro.Rmd
Log:
Changes to text output in thermo.refs() and subcrt()


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2020-07-04 04:53:42 UTC (rev 542)
+++ pkg/CHNOSZ/DESCRIPTION	2020-07-04 07:08:01 UTC (rev 543)
@@ -1,6 +1,6 @@
 Date: 2020-07-04
 Package: CHNOSZ
-Version: 1.3.6-17
+Version: 1.3.6-18
 Title: Thermodynamic Calculations and Diagrams for Geochemistry
 Authors at R: c(
     person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"),

Modified: pkg/CHNOSZ/NAMESPACE
===================================================================
--- pkg/CHNOSZ/NAMESPACE	2020-07-04 04:53:42 UTC (rev 542)
+++ pkg/CHNOSZ/NAMESPACE	2020-07-04 07:08:01 UTC (rev 543)
@@ -76,6 +76,6 @@
   "uniroot", "median")
 importFrom("utils", "browseURL", "capture.output", "combn", "demo",
   "example", "head", "installed.packages", "read.csv", "tail",
-  "write.csv", "write.table", "read.table")
+  "write.csv", "write.table", "read.table", "packageDescription")
 # 20190420 new R functions for HCL color palettes
 if (getRversion() >= "3.6.0") importFrom("grDevices", "hcl.pals", "hcl.colors")

Modified: pkg/CHNOSZ/R/subcrt.R
===================================================================
--- pkg/CHNOSZ/R/subcrt.R	2020-07-04 04:53:42 UTC (rev 542)
+++ pkg/CHNOSZ/R/subcrt.R	2020-07-04 07:08:01 UTC (rev 543)
@@ -199,8 +199,10 @@
     # include units here 20190530
     uT <- outvert(T, "K")
     if(identical(grid,'IS')) uT <- unique(uT)
-    if(length(uT)==1) T.text <- paste(uT, T.units()) else {
-      T.text <- paste0(length(uT), " values of T (", T.units(), ")")
+    Tunits <- T.units()
+    if(Tunits=="C") Tunits <- "\u00BAC"
+    if(length(uT)==1) T.text <- paste(uT, Tunits) else {
+      T.text <- paste0(length(uT), " values of T (", Tunits, ")")
     }
     uP <- outvert(P, "bar")
     if(length(P)==1) {

Modified: pkg/CHNOSZ/R/util.data.R
===================================================================
--- pkg/CHNOSZ/R/util.data.R	2020-07-04 04:53:42 UTC (rev 542)
+++ pkg/CHNOSZ/R/util.data.R	2020-07-04 07:08:01 UTC (rev 543)
@@ -105,10 +105,11 @@
     .cat("</head>")
     ### boilerplate text
     .cat("<body>")
-    .cat('<h1>References for thermodynamic data in <a href="http://chnosz.net"><font color="red">CHNOSZ</font></a></h1>')
+    .cat(paste0('<h1>References for thermodynamic data in <a href="http://chnosz.net"><font color="red">CHNOSZ</font></a> ',
+               packageDescription("CHNOSZ")$Version), " (", packageDescription("CHNOSZ")$Date, ')</h1>')
     .cat("<h3>Click on a column header to sort, or on a citation to open the URL in new window.</h3>")
-    .cat("<h4>Column 'number' gives the number of times each reference appears in thermo$OBIGT.</h4>")
-    .cat('<p>See also the vignette <a href="http://chnosz.net/vignettes/OBIGT.html">Thermodynamic data in CHNOSZ</a>.</p>')
+    .cat("<h4>Column 'number' gives the number of times each reference appears in thermo()$OBIGT.</h4>")
+    .cat('<p>See also the vignette <a href="http://chnosz.net/vignettes/OBIGT.html">OBIGT thermodynamic database in CHNOSZ</a>.</p>')
     ### start table and headers
     .cat("<table id='thermorefs' border='1'>")
     .cat("<tr>")

Modified: pkg/CHNOSZ/inst/CHECKLIST
===================================================================
--- pkg/CHNOSZ/inst/CHECKLIST	2020-07-04 04:53:42 UTC (rev 542)
+++ pkg/CHNOSZ/inst/CHECKLIST	2020-07-04 07:08:01 UTC (rev 543)
@@ -1,6 +1,6 @@
 ****************************
 release checklist for CHNOSZ
-    (updated 2020-06-30)
+    (updated 2020-07-04)
 ****************************
 
 - run examples() and demos() and inspect their output (especially plots)
@@ -44,7 +44,7 @@
 updating vignettes
 ******************
 
-- Customize rmarkdown installation (in R library directory)
+- Customize rmarkdown installation (in R local library)
 
   - to reduce size of vignettes: replace files in
     rmd/h/bootstrap/fonts/ with empty files

Modified: pkg/CHNOSZ/inst/NEWS
===================================================================
--- pkg/CHNOSZ/inst/NEWS	2020-07-04 04:53:42 UTC (rev 542)
+++ pkg/CHNOSZ/inst/NEWS	2020-07-04 07:08:01 UTC (rev 543)
@@ -1,36 +1,26 @@
-CHANGES IN CHNOSZ 1.3.6-17 (2020-07-04)
+CHANGES IN CHNOSZ 1.3.6-18 (2020-07-04)
 --------------------------------------
 
 MAJOR CHANGES
 
-- File, function and object names consistently use the uppercase
-  abbreviation OBIGT. In particular, the active database now lives at
-  thermo()$OBIGT, and functions add.OBIGT() and mod.OBIGT() replace
-  the previous add.obigt() and mod.obigt().
+- File, function, and object names consistently use the uppercase
+  abbreviation OBIGT. In particular, the active database now resides at
+  thermo()$OBIGT, and functions add.OBIGT() and mod.OBIGT() replace the
+  previous add.obigt() and mod.obigt().
 
-OTHER CHANGES
+CHANGES TO OBIGT DATABASE
 
-- Use updated data for the 2019 Deep Earth Water (DEW) model.
+- Update species parameters for the 2019 Deep Earth Water (DEW) model.
 
-- Move OBIGT/DEW_aq.csv to OBIGT/DEW.csv.
+- organic_aq.csv, AkDi.csv, DEW.csv: Remove "methane" as the name of
+  CH4(aq). This means that info("methane") now refers to the gas rather
+  than the aqueous species. This is consistent with the behavior for the
+  names of inorganic species, e.g. carbon dioxide and oxygen.
 
-- Use uncompressed files in OBIGT (i.e. .csv, not .csv.xz).
-
-- OBIGT/organic_aq.csv, AkDi.csv, DEW.csv: Remove "methane" as the
-  name of CH4(aq). Consequently, info("methane") refers to the gas
-  rather than aqueous species. This is consistent with the behavior for
-  the names of inorganic species, e.g. carbon dioxide and oxygen.
-
 - OBIGT/SUPCRT92.csv: Change lowercase to uppercase "A" (Angstrom) in
   names of minerals with suffixes indicating interlayer spacing
   (amesite, clinochlore, cronstedtite, daphnite).
 
-- Add demo/comproportionation.R: Gibbs energy of sulfur
-  comproportionation, after Amend et al., 2020.
-
-- subcrt(): change 'action.unbalanced' argument to 'autobalance',
-  which provides the ability to prevent autobalancing.
-
 - OBIGT/inorganic_aq.csv: Update arsenopyrite with data from Naumov et
   al., 1974 (via Unitherm).
 
@@ -39,18 +29,33 @@
 
 - Install bibtex file (docs/OBIGT.bib) for use in logKcalc package.
 
-- Changing the water model with water() now updates the literature
-  references in thermo()$OBIGT.
+- Use uncompressed data files (i.e. .csv, not .csv.xz) and rename
+  DEW_aq.csv to DEW.csv.
 
+DEMOS AND VIGNETTES
+
+- Add demo/comproportionation.R: Gibbs energy of sulfur
+  comproportionation, after Amend et al., 2020.
+
+- Remove vignete hotspring.Rnw.
+
 - Revise OBIGT.Rmd to reduce the size of the HTML file and make
   deep linking to individual sections work.
 
-- Remove vignete hotspring.Rnw.
+CHANGES TO FUNCTIONS
 
-- TODO: thermo.refs(): add current date, write 'thermo()$OBIGT'.
+- subcrt(): change 'action.unbalanced' argument to 'autobalance',
+  which provides the ability to prevent autobalancing.
 
-- TODO: use degree sign in messages from subcrt().
+- Changing the water model with water() now updates the literature
+  references in thermo()$OBIGT.
 
+- thermo.refs() now shows CHNOSZ version and date.
+
+- subcrt() uses degree symbol in messages (°C).
+
+TODO
+
 - TODO: fix error in expr.species("AsO4---")
 
 - TODO: describe default logact in basis.Rd
@@ -63,6 +68,10 @@
 
 - TODO: refresh extdata/supcrt/compare.R
 
+- TODO: get arsenopyrite from Perfetti et al., 2008
+
+- TODO: convert equilibrium.Rnw to equilibrium.Rmd
+
 CHANGES IN CHNOSZ 1.3.6 (2020-03-16)
 ------------------------------------
 

Modified: pkg/CHNOSZ/man/thermo.Rd
===================================================================
--- pkg/CHNOSZ/man/thermo.Rd	2020-07-04 04:53:42 UTC (rev 542)
+++ pkg/CHNOSZ/man/thermo.Rd	2020-07-04 07:08:01 UTC (rev 543)
@@ -99,7 +99,7 @@
 
   Each entry is referenced to one or two literature sources listed in \code{thermo()$refs}.
   Use \code{\link{thermo.refs}} to look up the citation information for the references.
-  See the vignette \emph{Thermodynamic data in CHNOSZ} for a complete description of the sources of data.
+  See the vignette \emph{OBIGT thermodynamic database in CHNOSZ} for a complete description of the sources of data.
   The original \acronym{OBIGT} database was influenced by the \acronym{SUPCRT92} (Johnson et al., 1992) and \acronym{slop98.dat} data files (Shock et al., 1998), and the references in those files are included here.
 
 In order to represent thermodynamic data for minerals with phase transitions, the higher-temperature phases of these minerals are represented as phase species that have states denoted by \samp{cr2}, \samp{cr3}, etc.

Modified: pkg/CHNOSZ/tests/testthat/test-ionize.aa.R
===================================================================
--- pkg/CHNOSZ/tests/testthat/test-ionize.aa.R	2020-07-04 04:53:42 UTC (rev 542)
+++ pkg/CHNOSZ/tests/testthat/test-ionize.aa.R	2020-07-04 07:08:01 UTC (rev 543)
@@ -2,8 +2,8 @@
 
 test_that("handling of repeated T, P, pH values is correct", {
   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 \\(C\\) and P \\(bar\\) \\(wet\\)")
-  expect_message(ia.25x10 <- ionize.aa(T=rep(25,10), ret.val="pK"), "18 species at 25 C and 1 bar \\(wet\\)")
+                              "18 species at 3 values of T \\(\u00BAC\\) and P \\(bar\\) \\(wet\\)")
+  expect_message(ia.25x10 <- ionize.aa(T=rep(25,10), ret.val="pK"), "18 species at 25 \u00BAC and 1 bar \\(wet\\)")
   # we have ten rows of the same values
   expect_identical(ia.25x10[1, ], apply(ia.25x10, 2, unique))
   # also ten rows of the same values for same pH

Modified: pkg/CHNOSZ/vignettes/anintro.Rmd
===================================================================
--- pkg/CHNOSZ/vignettes/anintro.Rmd	2020-07-04 04:53:42 UTC (rev 542)
+++ pkg/CHNOSZ/vignettes/anintro.Rmd	2020-07-04 07:08:01 UTC (rev 543)
@@ -243,7 +243,7 @@
 As the database includes datasets from many sources, it can not be guaranteed to be fully internally consistent.
 For crucial problems, check not only the accuracy of entries in the database, but also the *suitability of the data* for your problem.
 If there are any doubts, consult the primary sources.
-Use <span style="color:blue">`thermo.refs()`</span> to show a list of references for the data; see also the vignette, [<span style="color:blue">*Thermodynamic data in CHNOSZ*</span>](OBIGT.html), for more information.
+Use <span style="color:blue">`thermo.refs()`</span> to show a list of references for the data; see also the vignette, [<span style="color:blue">*OBIGT thermodynamic database in CHNOSZ*</span>](OBIGT.html), for more information.
 
 ## The <span style="color:green">`info()`</span> function
 
@@ -1934,7 +1934,7 @@
 You can locate and view the references with <span style="color:green">`thermo.refs()`</span>.
 Running the function without any arguments opens a browser window with the complete table of references.
 ```{marginfigure}
-See the vignette, [<span style="color:blue">*Thermodynamic data in CHNOSZ*</span>](OBIGT.html), for a more nicely formatted presentation of the sources of thermodynamic data, along with notes and additional comments.
+See the vignette, [<span style="color:blue">*OBIGT thermodynamic database in CHNOSZ*</span>](OBIGT.html), for a more nicely formatted presentation of the sources of thermodynamic data, along with notes and additional comments.
 ```
 Where available, links to the web page for the articles and books are displayed:
 ```{r thermo_refs_table, eval=FALSE}
@@ -2004,7 +2004,7 @@
 
 <span style="color:red">`add.OBIGT("AkDi")`</span> -- These data are used in the Akinfiev-Diamond model for aqeuous nonelectrolytes [@AD03].
 
-Detailed references for these optional datasets are in the vignette [<span style="color:blue">*Thermodynamic data in CHNOSZ*</span>](OBIGT.html) (look under **Optional Data**).
+Detailed references for these optional datasets are in the vignette [<span style="color:blue">*OBIGT thermodynamic database in CHNOSZ*</span>](OBIGT.html) (look under **Optional Data**).
 
 ## Adding data
 



More information about the CHNOSZ-commits mailing list