Repository navigation
Validation thresholds in compareScenarios - #2493
Conversation
|
How much does this increase CS2 time (both with and without validation thresholds)? |
Would expect it to be 30s to 5min max, depending on config and number of runs being compared. No change expected if config is NULL as no validation is run. |
|
And another thing: maybe test if this breaks the AMTs or even integrate it validationConfig if you find it useful there. Last time I touched this code I broke them. (coordinate with @tobiasdiez on his refactoring of modelstats) |
| if (!is.null(validationConfig)) { | ||
| args$validationConfig <- validationConfig | ||
| } | ||
| args$validationConfig <- validationConfig |
There was a problem hiding this comment.
put that directly in the definition of the args aboce
There was a problem hiding this comment.
that would break backwards compatibility, I'd rather keep it here
There was a problem hiding this comment.
I think adding it to the definition of args directly above does not change the behavior
There was a problem hiding this comment.
yes it does, if the argument is NULL, it would still create args$validationConfig if created in the list, while args$validationConfig <- NULL will not create it. Older versions will not expect that arg and throw an error in the first case.
There was a problem hiding this comment.
Ah, I learned another weird quirk of R today
Purpose of this PR
Validation thresholds can now be included into line plots in compareScenarios via the following changes:
validationConfigas optional argument of a compareScenarios profile which is handed topiamPlotComparison::compareScenarios.preprocessing.R, no changes to plot callsgetThresholdBands()which is the outsourced version of how the colored background areas were calculated inlinePlotThresholds()before.showLinePlots()and the new functionaddThresholdBands()plots the colored areas below line plots if variable, unit region and period match.It boils down to using the default REMIND thresholds in the AMT validationConfig (via the new
validationConfigparameter) on the runs that were selected for a compareScenarios execution, together with their historical data for checks that are relative to reference data. It has been implemented in a way which avoids needing to make changes to the plotting calls in the cs RMDs by checking if a given variable has thresholds available that can be plotted.For now, the REMIND scripts use
NULLas default, so it won't yet run the validation, until further testing has been done.Example:

Type of change
Indicate the items relevant for your PR by replacing ◻️ with ☑️.
Do not delete any lines. This makes it easier to understand which areas are affected by your changes and which are not.
Parts concerned
Impact
Checklist
Do not delete any line. Leave unfinished elements unchecked so others know how far along you are.
In the end all checkboxes must be ticked before you can merge.
make test) after my final commit and all tests pass (FAIL 0)remind2if and where it was neededforbiddenColumnNamesin readCheckScenarioConfig.R in case the PR leads to deprecated switchesCHANGELOG.mdcorrectly (added, changed, fixed, removed, input data/calibration)Further information (optional)
A test cs is available here: https://cloud.pik-potsdam.de/index.php/f/30284389
Note, that most variable do not have validation thresholds. Find a list of which variables are checked how here:
https://pik-piam.github.io/piamValidation/articles/configs/validationConfig_REMIND.html