Skip to content

Commit

Permalink
updated manual test data for comparing actual vs previous version. Re…
Browse files Browse the repository at this point in the history
…f-results are now v0.6.0
  • Loading branch information
Paul Schmidt-Walter committed Oct 16, 2024
1 parent c820cb1 commit 33c9691
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Binary file modified tests_compare_actual_vs_previous/simresults.rds
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,28 @@
# to check if some unwanted changes have been made
# it will work savely only, if actual and previous results were created on the same machine.
# machine: oflks593
# ref-version: v0.5.3
# ref-version: v0.6.0

library(LWFBrook90R)
library(data.table)
library(testthat)

res_previous <- readRDS("tests_compare_actual_vs_previous/simresults.rds")
meteo <- readRDS("tests_compare_actual_vs_previous/meteo.rds")
input <- res_previous$model_input
setDT(meteo)

input$param_b90$water_table_depth <- -9999 # new input-parameters
input$param_b90$snowlqini <- 0
input$param_b90$snowccini <- 0

res_actual <- run_LWFB90(options_b90 = input$options_b90,
param_b90 = input$param_b90,
climate = meteo)

res_previous$layer_output <- res_previous$layer_output[order(nl, yr, doy)]
#res_previous$layer_output <- res_previous$layer_output[order(nl, yr, doy)]

test_that("sim-outputs of actual are equal to previous", {
expect_equal(res_actual$output[,-which(names(res_actual$output) %in% c("snowlq", "cc")), with = F], res_previous$output)
expect_equal(res_actual$layer_output[,-which(names(res_actual$layer_output) %in% c("relawati")), with = F], res_previous$layer_output)
expect_equal(res_actual$output,
res_previous$output)
expect_equal(res_actual$layer_output,
res_previous$layer_output)
})

test_that("sim-inputs of actual are equal to previous", {
Expand Down

0 comments on commit 33c9691

Please sign in to comment.