Skip to content

Commit

Permalink
suppress madrat standard config for start.R
Browse files Browse the repository at this point in the history
  • Loading branch information
orichters committed Aug 2, 2023
1 parent 4d7ae0e commit 443e0c4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/start/readCheckScenarioConfig.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ readCheckScenarioConfig <- function(filename, remindPath = ".", testmode = FALSE
}
nameisNA <- grepl("^NA$", rownames(scenConf))
if (any(nameisNA)) {
warning("Don't use 'NA' as scenario name, you fool. Stopping now.")
warning("Do not use 'NA' as scenario name, you fool. Stopping now.")
}
illegalchars <- grepl("[^[:alnum:]_-]", rownames(scenConf))
if (any(illegalchars)) {
Expand Down
3 changes: 3 additions & 0 deletions start.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ if ( 'TRUE' != Sys.getenv('ignoreRenvUpdates')
Sys.sleep(1)
}

# initialize madrat settings
invisible(madrat::getConfig(verbose = FALSE))

errorsfound <- 0 # counts ignored errors in --test mode
startedRuns <- 0
waitingRuns <- 0
Expand Down
3 changes: 3 additions & 0 deletions start_bundle_coupled.R
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ if (file.exists("/p") && sum(scenarios_coupled[common, "qos"] == "priority", na.
######## PREPARE AND START COUPLED RUNS ############
####################################################

# initialize madrat settings
invisible(madrat::getConfig(verbose = FALSE))

# prepare runs: write RData files
for(scen in common){
message("\n################################\nPreparing run ", scen, "\n")
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test_01-readCheckScenarioConfig.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ test_that("readCheckScenarioConfig fails on error-loaden config", {
expect_match(w, "scenario names indicated in copyConfigFrom column were not found", all = FALSE, fixed = TRUE)
expect_match(w, "specify in copyConfigFrom column a scenario name defined below in the file", all = FALSE, fixed = TRUE)
expect_match(w, "which requires a reference gdx", all = FALSE, fixed = TRUE)
expect_match(w, "Do not use 'NA' as scenario name", all = FALSE, fixed = TRUE)
expect_match(m, "no column path_gdx_refpolicycost for policy cost comparison found, using path_gdx_ref instead", all = FALSE, fixed = TRUE)
expect_match(m, "In 1 scenarios, neither 'carbonprice'", all = FALSE, fixed = TRUE)
copiedFromPBS <- c("c_budgetCO2", "path_gdx", "path_gdx_ref")
Expand Down

0 comments on commit 443e0c4

Please sign in to comment.