Skip to content

Commit

Permalink
Merge pull request #1580 from orichters/smallfix4
Browse files Browse the repository at this point in the history
repair 'make test-full': remove fails for coupled runs, cleanup start_bundle_coupled, remove outdated configs
  • Loading branch information
orichters authored Feb 28, 2024
2 parents 4e127c3 + 6fa1a91 commit e72d966
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 135 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Imports:
raster,
readr,
readxl,
remind2 (>= 1.125.0),
remind2 (>= 1.135.6),
renv,
reshape2,
reticulate,
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ test-full: ## Run all tests, including coupling tests and a default
$(info Full tests take more than an hour to run, please be patient)
@TESTTHAT_RUN_SLOW=TRUE Rscript -e 'testthat::test_dir("tests/testthat")'

test-full-slurm: ##test-full, but on slurm
$(info Full tests take more than an hour to run, please be patient)
@sbatch --qos=priority --wrap="make test-full" --job-name=test-full --mail-type=END --output=test-full.log --comment="test-full.log"

test-validation: ## Run validation tests, requires a full set of runs in the output folder
$(info Run validation tests, requires a full set of runs in the output folder)
@TESTTHAT_RUN_SLOW=TRUE Rscript -e 'testthat::test_dir("tests/testthat/validation")'
Expand Down
48 changes: 0 additions & 48 deletions config/scenario_config_GCS.csv

This file was deleted.

36 changes: 0 additions & 36 deletions config/scenario_config_coupled_SHAPE.csv

This file was deleted.

2 changes: 0 additions & 2 deletions config/scenario_config_tradeCap_standalone.csv

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/output/export/xlsx_IIASA.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ lucode2::readArgs("outputdirs", "filename_prefix", "outputFilename", "model",
if (is.null(mapping)) {
mapping <- gms::chooseFromList(names(piamInterfaces::templateNames()), type = "mapping template")
}
if (length(mapping) == 0 || ! all(file.exists(mapping) | mapping %in% names(templateNames())))
if (length(mapping) == 0 || ! all(file.exists(mapping) | mapping %in% names(templateNames()))) {
stop("mapping='", paste(mapping, collapse = ", "), "' not found.")
}
if (exists("iiasatemplate") && ! is.null(iiasatemplate) && ! file.exists(iiasatemplate)) {
Expand Down
15 changes: 5 additions & 10 deletions scripts/output/single/reporting.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,8 @@ load(configfile, envir = envir)

# produce REMIND reporting *.mif based on gdx information
message("\n### start generation of mif files at ", Sys.time())
tmp <- try(convGDX2MIF(gdx, gdx_refpolicycost = gdx_refpolicycost, file = remind_reporting_file,
scenario = scenario, gdx_ref = gdx_ref)) # try to execute convGDX2MIF
if (inherits(tmp, "try-error")) {
convGDX2MIF_REMIND2MAgPIE(gdx, file = remind_reporting_file, scenario = scenario)
}
convGDX2MIF(gdx, gdx_refpolicycost = gdx_refpolicycost, file = remind_reporting_file,
scenario = scenario, gdx_ref = gdx_ref)

# MAGICC code not working with REMIND-EU
# generate MAGICC reporting and append to REMIND reporting
Expand Down Expand Up @@ -122,11 +119,9 @@ if (! is.null(magpie_reporting_file) && file.exists(magpie_reporting_file)) {
message("### end generation of mif files at ", Sys.time())

## produce REMIND LCOE reporting *.csv based on gdx information
if (! isTRUE(envir$cfg$gms$c_empty_model == "on") || ! grepl("^C_TESTTHAT", scenario)) {
message("### start generation of LCOE reporting at ", Sys.time())
tmp <- try(convGDX2CSV_LCOE(gdx,file=LCOE_reporting_file,scen=scenario)) # execute convGDX2MIF_LCOE
message("### end generation of LCOE reporting at ", Sys.time())
}
message("### start generation of LCOE reporting at ", Sys.time())
tmp <- try(convGDX2CSV_LCOE(gdx,file=LCOE_reporting_file,scen=scenario)) # execute convGDX2MIF_LCOE
message("### end generation of LCOE reporting at ", Sys.time())

## generate DIETER reporting if it is needed
## the reporting is appended to REMIND_generic_<scenario>.MIF in "DIETER" Sub Directory
Expand Down
Loading

0 comments on commit e72d966

Please sign in to comment.