From 826cf9a2687ff1d7ca5b568882f5686f76f82074 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 30 Jan 2017 14:11:34 +0100 Subject: Use relative tolerance of 1e-6 for flux test to pass test also for more extreme situations as in the current test data. --- ChangeLog | 12 ++++++++++++ tests/testthat/test_PELMO.R | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 974436f..e769feb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +commit eea72720956dc8358fac98b29c9a627a9363cbd2 +Author: Johannes Ranke +Date: 2017-01-30 13:12:24 +0100 + + Better documentation of PELMO_runs(). + +commit d78d2effd517ab3c27412ae6f4ae701c456ae590 +Author: Johannes Ranke +Date: 2017-01-30 12:46:57 +0100 + + pfm for windows in my drat + commit eaf3b558747ff8228e87ded727a6c0e91a6579f8 Author: Johannes Ranke Date: 2017-01-30 12:01:14 +0100 diff --git a/tests/testthat/test_PELMO.R b/tests/testthat/test_PELMO.R index ab0e37a..a08f607 100644 --- a/tests/testthat/test_PELMO.R +++ b/tests/testthat/test_PELMO.R @@ -119,12 +119,14 @@ test_that("PELMO runs are correctly evaluated", { period_pfm_file <- file.path(PELMO_base, "FOCUS", pp, "period_pfm.rda") load(period_pfm_file) + #message(psm, " ", crop, " ", scenario) + # Test for equality of all the components separately, # as we need to adapt the tolerance for (acronym in acronyms) { p_pelmo <- results[[acronym]]$periods p_test <- results_pfm[[acronym]]$periods - expect_equal(p_test$flux, p_pelmo$flux, tol = 1e-6, scale = 1) + expect_equal(p_test$flux, p_pelmo$flux, tol = 1e-6) expect_equal(p_test$percolate, p_pelmo$percolate) # PELMO sets the concentration to 0 when the percolate is zero. # We get NaN, which is more reasonable, but we need to -- cgit v1.2.1