Commit e696b80f authored by Dorchies David's avatar Dorchies David
Browse files

fix(CreateRunOptions): slow calibration with CemaNeige models

- "Un seul 'else' vous manque et tout est dépeuplé..." (
Alphonse de Lamartine)

Fix #136
parent 477a3a2e
Pipeline #27397 failed with stages
in 5 minutes and 57 seconds
......@@ -337,8 +337,7 @@ CreateRunOptions <- function(FUN_MOD, InputsModel,
if ("CemaNeige" %in% ObjectClass) {
Outputs_Cal <- c("PliqAndMelt", Outputs_Cal)
}
}
if ("CemaNeige" %in% ObjectClass) {
} else if ("CemaNeige" %in% ObjectClass) {
Outputs_Cal <- c("all")
}
} else {
......
......@@ -25,9 +25,10 @@ dfBM <- cbind(version = as.character(packageVersion('airGR')), dfBM)
file <- "tests/tmp/benchmark.txt"
dir.create("tests/tmp", showWarnings = FALSE)
write.table(dfBM, file = file,
row.names = FALSE, col.names = !file.exists(file), quote = FALSE,
sep = "\t", append = TRUE)
sep = "\t", append = file.exists(file))
df <- read.table(file = file, sep = "\t", header = TRUE)
if(length(unique(df$version)) > 1) {
......@@ -39,7 +40,7 @@ if(length(unique(df$version)) > 1) {
dfMean <- cbind(model = sModelNames, as.data.frame(t(do.call(rbind, lV))))
dfMean$evolution <- (dfMean[,3] - dfMean[,2]) / dfMean[,2]
write.table(dfMean, "tests/tmp/mean_execution_time.txt", row.names = FALSE, quote = F, sep = "\t")
res <- testthat::test_file("tests/testthat/benchmark_RunModel.R")
res <- testthat::test_file("tests/testthat/benchmarkRunModel.R")
dRes <- as.data.frame(res)
if (any(dRes[, "failed"] > 0) | any(dRes[, "error"])) {
quit(status = 1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment