From 4835e20d1d08203657ab616600286ad9dfd71344 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 24 May 2017 15:46:44 +0200 Subject: Re-enable PELMO examples and tests - Add .gitattributes to make sure CRLF line endings are kept for PELMO .psm files - Update static docs --- .gitattributes | 1 + ChangeLog | 12 ++++++ DESCRIPTION | 2 +- R/PELMO_runs.R | 3 -- docs/reference/PELMO_runs.html | 78 ++++++++++++++++++++++++----------- docs/reference/one_box-2.png | Bin 5599 -> 5841 bytes docs/reference/one_box-4.png | Bin 5426 -> 5660 bytes docs/reference/one_box-8.png | Bin 9671 -> 10226 bytes docs/reference/plot.TOXSWA_cwa-2.png | Bin 7427 -> 7786 bytes docs/reference/plot.one_box-2.png | Bin 5653 -> 5891 bytes docs/reference/plot.one_box-4.png | Bin 10315 -> 10742 bytes docs/reference/plot.one_box-8.png | Bin 13307 -> 13953 bytes docs/reference/sawtooth-2.png | Bin 6018 -> 6217 bytes docs/reference/sawtooth-6.png | Bin 13307 -> 13953 bytes man/PELMO_runs.Rd | 3 -- test.log | 13 +----- tests/testthat/test_PELMO.R | 26 +++++++++--- 17 files changed, 89 insertions(+), 49 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..d60e817 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +inst/testdata/*.psm text eol=crlf diff --git a/ChangeLog b/ChangeLog index 6f5775d..f749300 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +commit 539ea37b45ddc41b36dd199f06ffe5936ab13f21 +Author: Johannes Ranke +Date: 2017-05-17 12:23:38 +0200 + + Documentation fix + +commit 62bffd4873bc53fa9cd81336efa716b220c83e0a +Author: Johannes Ranke +Date: 2017-05-17 09:36:22 +0200 + + Simplify tests where possible + commit d60bb9c0b52c8e0452bfbe507e60d5f651589cc8 Author: Johannes Ranke Date: 2017-05-16 18:57:16 +0200 diff --git a/DESCRIPTION b/DESCRIPTION index 484970a..fcefaa4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: pfm Type: Package Title: Utilities for Pesticide Fate Modelling Version: 0.4-3 -Date: 2017-05-17 +Date: 2017-05-24 Authors@R: person("Johannes Ranke", email = "jranke@uni-bremen.de", role = c("aut", "cre", "cph")) Description: Utilities for simple calculations of predicted environmental diff --git a/R/PELMO_runs.R b/R/PELMO_runs.R index c0d1266..432231e 100644 --- a/R/PELMO_runs.R +++ b/R/PELMO_runs.R @@ -33,8 +33,6 @@ #' PELMO test results \url{http://esdac.jrc.ec.europa.eu/public_path/projects_data/focus/gw/models/pelmo/test-results/test_results_FOCUS_PELMO_5_5_3.doc} #' @export #' @examples -#' # At the moment I can not run the examples, as my wine installation is not working -#' \dontrun{ #' # Reproduce the official test results for annual application of Pesticide D #' # to winter cereals at the day before emergence #' runs_1 <- list( @@ -56,7 +54,6 @@ #' PECgw_2 <- PELMO_runs(runs_2, psm_dir = system.file("testdata", package = "pfm"), #' cores = 3, overwrite = TRUE) #' print(PECgw_2) -#' } PELMO_runs <- function(runs, psm_dir = ".", version = "5.5.3", PELMO_base = "auto", execute = TRUE, cores = getOption("mc.cores", 2L), evaluate = TRUE, overwrite = FALSE) diff --git a/docs/reference/PELMO_runs.html b/docs/reference/PELMO_runs.html index ed7975e..3b64c6e 100644 --- a/docs/reference/PELMO_runs.html +++ b/docs/reference/PELMO_runs.html @@ -150,30 +150,60 @@ the period.plm file generated by the FOCUS PELMO GUI.

Examples

-
# At the moment I can not run the examples, as my wine installation is not working -not_run({ - # Reproduce the official test results for annual application of Pesticide D - # to winter cereals at the day before emergence - runs_1 <- list( - list(psm = 'Pesticide_D', - win = c("Cha", "Ham", "Jok", "Kre", "Oke", "Pia", "Por", "Sev", "Thi")), - list(psm = 'Pesticide_D_1_day_pre_em_every_third_year', - pot = c("Cha", "Ham", "Jok", "Kre", "Oke", "Pia", "Por", "Sev", "Thi"))) - time_1 <- system.time( - PECgw_1 <- PELMO_runs(runs_1, psm_dir = system.file("testdata", package = "pfm"), - cores = 6, overwrite = TRUE) - ) - print(PECgw_1) - # We get exactly the same PECgw values (on Linux, calling PELMO using Wine). - print(time_1) - - # Demonstrate some results with metabolites. - runs_2 <- list(list(psm = 'Pesticide_D_1_May_every_other_year_mets', - win = c("Cha", "Ham", "Kre"))) - PECgw_2 <- PELMO_runs(runs_2, psm_dir = system.file("testdata", package = "pfm"), - cores = 3, overwrite = TRUE) - print(PECgw_2) -})
+
# Reproduce the official test results for annual application of Pesticide D +# to winter cereals at the day before emergence +runs_1 <- list( + list(psm = 'Pesticide_D', + win = c("Cha", "Ham", "Jok", "Kre", "Oke", "Pia", "Por", "Sev", "Thi")), + list(psm = 'Pesticide_D_1_day_pre_em_every_third_year', + pot = c("Cha", "Ham", "Jok", "Kre", "Oke", "Pia", "Por", "Sev", "Thi"))) +time_1 <- system.time( + PECgw_1 <- PELMO_runs(runs_1, psm_dir = system.file("testdata", package = "pfm"), + cores = 6, overwrite = TRUE) +) +print(PECgw_1)
#> $Pesticide_D +#> $Pesticide_D$win +#> FOCUS DUMMY D +#> Cha 0.025 +#> Ham 1.621 +#> Jok 0.388 +#> Kre 0.467 +#> Oke 1.608 +#> Pia 0.848 +#> Por 2.386 +#> Sev 0.009 +#> Thi 0.030 +#> +#> +#> $Pesticide_D_1_day_pre_em_every_third_year +#> $Pesticide_D_1_day_pre_em_every_third_year$pot +#> FOCUS DUMMY D +#> Cha 0.010 +#> Ham 0.014 +#> Jok 0.009 +#> Kre 0.027 +#> Oke 0.085 +#> Pia 0.051 +#> Por 0.021 +#> Sev 0.000 +#> Thi 0.001 +#> +#>
# We get exactly the same PECgw values (on Linux, calling PELMO using Wine). +print(time_1)
#> User System verstrichen +#> 219.860 0.960 55.449
+# Demonstrate some results with metabolites. +runs_2 <- list(list(psm = 'Pesticide_D_1_May_every_other_year_mets', + win = c("Cha", "Ham", "Kre"))) +PECgw_2 <- PELMO_runs(runs_2, psm_dir = system.file("testdata", package = "pfm"), + cores = 3, overwrite = TRUE) +print(PECgw_2)
#> $Pesticide_D_1_May_every_other_year_mets +#> $Pesticide_D_1_May_every_other_year_mets$win +#> FOCUS DUMMY D M1 M2 +#> Cha 0.001 126.195 0.000 +#> Ham 0.054 82.196 0.001 +#> Kre 0.103 75.494 0.001 +#> +#>