Skip to content

Commit

Permalink
New tests for monthly scaling parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
dschlaep committed Feb 19, 2025
1 parent 8b200ae commit 678094b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/testthat/test_WeatherData.R
Original file line number Diff line number Diff line change
Expand Up @@ -433,3 +433,24 @@ test_that("Weather data fixing", {
)

})


test_that("Weather data scaling", {
swin <- rSOILWAT2::sw_exampleData

ref <- sw_exec(swin)

scalingParams <- setdiff(
colnames(swWeather_MonScalingParams(x)),
"ShortWR" # ShortWR only works if we provide daily radiation as input
)

for (k in seq_along(scalingParams)) {
x <- swin
swWeather_MonScalingParams(x)[, scalingParams[[k]]] <- 2
res <- sw_exec(x)

# Expect that the scaled simulation produces different SWC than the default
expect_false(isTRUE(all.equal(res@SWCBULK@Day, ref@SWCBULK@Day)))
}
})

0 comments on commit 678094b

Please sign in to comment.