diff --git a/DESCRIPTION b/DESCRIPTION index be3ed69f4..bf9455e60 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -43,7 +43,7 @@ Imports: magclass, magpie4 (>= 2.3.10), magpiesets, - mip (>= 0.149.3), + mip (>= 0.150.0), modelstats, mrremind, mrvalidation, @@ -51,7 +51,7 @@ Imports: nleqslv, optparse, piamenv (>= 0.4.0), - piamInterfaces (>= 0.27.0), + piamInterfaces (>= 0.27.2), piamPlotComparison (>= 0.0.10), piamutils, plotly, diff --git a/scripts/output/comparison/selectPlots.R b/scripts/output/comparison/selectPlots.R index 1a89f951e..10497c3d9 100644 --- a/scripts/output/comparison/selectPlots.R +++ b/scripts/output/comparison/selectPlots.R @@ -29,13 +29,13 @@ postfix <- paste0(ifelse(filename_prefix == "", "", "-"), filename_prefix, timeS histPath <- remind2::getMifHistPath(outputdirs[1], mustWork = TRUE) -scenario <- lucode2::getScenNames(outputdirs) -mifs <- file.path(outputdirs, paste0("REMIND_generic_", scenario, ".mif")) -newnames <- make.unique(basename(outputdirs), sep = "_") +scenarios <- lucode2::getScenNames(outputdirs) +mifs <- file.path(outputdirs, paste0("REMIND_generic_", scenarios, ".mif")) +newnames <- make.unique(basename(outputdirs), sep = "_") message("Do you want to remove the timestamp from scenario names and shorten coupled runs? y/N") if (tolower(gms::getLine()) %in% c("y", "yes")) { - newnames <- make.unique(gsub("^C_", "", gsub("-rem-([0-9]+)$", "-\\1", scenario)), sep = "_") - duplicates <- duplicated(scenario) | duplicated(scenario, fromLast = TRUE) + newnames <- make.unique(gsub("^C_", "", gsub("-rem-([0-9]+)$", "-\\1", scenarios)), sep = "_") + duplicates <- duplicated(scenarios) | duplicated(scenarios, fromLast = TRUE) if (any(duplicates)) { message("\nAvoiding duplicates:\n", paste(paste(basename(outputdirs), "->", newnames)[duplicates], collapse = "\n")) @@ -43,7 +43,10 @@ if (tolower(gms::getLine()) %in% c("y", "yes")) { } message("\nLoading data...") -mifs <- lapply(seq_along(mifs), function(x) mutate(as.quitte(mifs[x]), scenario = factor(newnames[x]))) +loadAdjust <- function(x) { + mutate(as.quitte(mifs[x]), model = factor("REMIND"), scenario = factor(newnames[x])) +} +mifs <- lapply(seq_along(mifs), loadAdjust) plotIntercomparison(list(mifs, histPath), summationsFile = "extractVariableGroups", outputDirectory = "output/plots",