Skip to content

Commit

Permalink
Merge pull request #9 from fbenke-pik/master
Browse files Browse the repository at this point in the history
remove outdated section from 'Further Info'
  • Loading branch information
fbenke-pik authored Apr 25, 2024
2 parents c1c4da8 + ecd2c2a commit 58ae8b2
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '198360'
ValidationKey: '218218'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cff-version: 1.2.0
message: If you use this software, please cite it using the metadata from this file.
type: software
title: 'piamPlotComparison: Create comparison plots for your model results'
version: 0.0.10
date-released: '2024-04-23'
version: 0.0.11
date-released: '2024-04-25'
abstract: A frameworks to create comparison plots for your model results.
authors:
- family-names: Benke
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: piamPlotComparison
Title: Create comparison plots for your model results
Version: 0.0.10
Date: 2024-04-23
Version: 0.0.11
Date: 2024-04-25
Authors@R: c(
person("Falk", "Benke", , "[email protected]", role = c("aut", "cre")),
person("Christof", "Schoetz", role = "aut")
Expand Down
9 changes: 0 additions & 9 deletions R/compareScenarios.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@
#' scenario. The paths must be provided in the same order as \code{mifScen}.
#' If provided, some information gathered from these files is
#' shown at the beginning of the output document.}
#' \item{\code{cfgDefault}}{
#' \code{character(1) or NULL}.
#' Path to default.cfg, which creates a \code{cfg} object with default
#' values. If provided, some information gathered from this file is
#' shown at the beginning of the output document.}
#' \item{\code{docTitle}}{
#' \code{character(n) or NULL}.
#' Title of the document. Defaults to 'Compare Scenarios'}
Expand Down Expand Up @@ -108,7 +103,6 @@
#' mifScen = c(ScenarioName1 = "path/to/scen1.mif", ScenarioName2 = "path/to/scen2.mif"),
#' mifHist = "path/to/historical.mif",
#' cfgScen = c("path/to/scen1/config.RData", "path/to/scen2/config.RData"),
#' cfgDefault = "path/to/default.cfg",
#' outputDir = "path/to/output",
#' outputFormat = "Rmd",
#' outputFile = format(Sys.time(), "compScen_%Y%m%d-%H%M%S"),
Expand Down Expand Up @@ -144,9 +138,6 @@ compareScenarios <- function(
if (!is.null(yamlParams[["cfgScen"]])) {
yamlParams$cfgScen <- normalizePath(yamlParams$cfgScen, mustWork = TRUE)
}
if (!is.null(yamlParams[["cfgDefault"]])) {
yamlParams$cfgDefault <- normalizePath(yamlParams$cfgDefault, mustWork = TRUE)
}
if (!is.null(yamlParams[["userSectionPath"]])) {
yamlParams$userSectionPath <- normalizePath(yamlParams$userSectionPath, mustWork = TRUE)
}
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Create comparison plots for your model results

R package **piamPlotComparison**, version **0.0.10**
R package **piamPlotComparison**, version **0.0.11**

[![CRAN status](https://www.r-pkg.org/badges/version/piamPlotComparison)](https://cran.r-project.org/package=piamPlotComparison) [![R build status](https://github.com/pik-piam/piamPlotComparison/workflows/check/badge.svg)](https://github.com/pik-piam/piamPlotComparison/actions) [![codecov](https://codecov.io/gh/pik-piam/piamPlotComparison/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/piamPlotComparison) [![r-universe](https://pik-piam.r-universe.dev/badges/piamPlotComparison)](https://pik-piam.r-universe.dev/builds)

Expand Down Expand Up @@ -46,7 +46,7 @@ In case of questions / problems please contact Falk Benke <[email protected]>

To cite package **piamPlotComparison** in publications use:

Benke F, Schoetz C (2024). _piamPlotComparison: Create comparison plots for your model results_. R package version 0.0.10, <https://github.com/pik-piam/piamPlotComparison>.
Benke F, Schoetz C (2024). _piamPlotComparison: Create comparison plots for your model results_. R package version 0.0.11, <https://github.com/pik-piam/piamPlotComparison>.

A BibTeX entry for LaTeX users is

Expand All @@ -55,7 +55,7 @@ A BibTeX entry for LaTeX users is
title = {piamPlotComparison: Create comparison plots for your model results},
author = {Falk Benke and Christof Schoetz},
year = {2024},
note = {R package version 0.0.10},
note = {R package version 0.0.11},
url = {https://github.com/pik-piam/piamPlotComparison},
}
```
47 changes: 0 additions & 47 deletions inst/compareScenarios/cs_99_further_info.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -86,56 +86,9 @@ if (exists("cfgGms") && !is.null(cfgGms)) {
cfgGmsWide %>%
select(-where(~ length(unique(.)) == 1)) %>%
select(scenario, everything())
cfgGmsWideSame <-
cfgGmsWide %>%
select(where(~ length(unique(.)) == 1)) %>%
distinct()
}
```


```{r results='asis'}
# Show all gms config option that is the same in all scenarios but differs from the default.
if (exists("cfgDefault") && !is.null(cfgDefault) &&
exists("cfgGmsWideSame") && !is.null(cfgGmsWideSame)) {
colNames <- intersect(names(cfgGmsWideSame), names(cfgDefault$gms))
# the types may differ between the two lists, so convert to character
isSameAsDefault <- vapply(
colNames,
function(nm) {
identical(
as.character(cfgDefault$gms[[nm]]),
as.character(unname(cfgGmsWideSame[[nm]])))
},
logical(1)
)
cfgGmsWideSameDiffDefault <-
bind_rows(
lapply(cfgGmsWideSame[colNames[!isSameAsDefault]], as.character),
lapply(cfgDefault$gms[colNames[!isSameAsDefault]], as.character))
cat("## GAMS Config Non-Default\n\n")
cat("Following GAMS settings are the same in all scenarios but different from the default settings.\n\n")
bind_cols(
Source = c("Scenarios", "Default"),
cfgGmsWideSameDiffDefault
) %>%
showInTables()
cat(
"Following GAMS settings are the same in all scenarios and not present in the default file:\n\n")
bind_cols(
Source = "Scenarios",
cfgGmsWideSame[setdiff(names(cfgGmsWideSame), names(cfgDefault$gms))]
) %>%
showInTables()
}
```


```{r results='asis'}
# Show all gms config options that differ between scenarios.
if (exists("cfgGmsWideDiff") && !is.null(cfgGmsWideDiff)) {
Expand Down
7 changes: 1 addition & 6 deletions inst/compareScenarios/cs_main.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ params:
mifScen: ""
mifScenNames: null
cfgScen: null
cfgDefault: null
mifHist: ""
yearsScen: !r c(seq(2005, 2060, 5), seq(2070, 2100, 10))
yearsHist: !r c(seq(1960, 2024, 1), seq(2025, 2100, 5))
Expand Down Expand Up @@ -119,11 +118,7 @@ if (!is.null(params$cfgScen)) {
filter(name != "gms")
rm(cfgs)
}
if (!is.null(params$cfgDefault)) {
env <- new.env()
source(params$cfgDefault, local = env, echo = FALSE) # nolint
cfgDefault <- env$cfg
}
```


Expand Down
6 changes: 0 additions & 6 deletions man/compareScenarios.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 58ae8b2

Please sign in to comment.