Skip to content

Commit

Permalink
Merge branch 'master' of github.com:pik-piam/remind2 into dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
fbenke-pik committed Sep 28, 2023
2 parents f504e08 + 411680b commit af9eae9
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '219589802'
ValidationKey: '219696204'
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
- 'Warning: namespace ''.*'' is not available and has been replaced'
Expand Down
6 changes: 4 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: 'remind2: The REMIND R package (2nd generation)'
version: 1.119.1
date-released: '2023-09-22'
version: 1.119.3
date-released: '2023-09-28'
abstract: Contains the REMIND-specific routines for data and model output manipulation.
authors:
- family-names: Rodrigues
Expand Down Expand Up @@ -65,6 +65,8 @@ authors:
given-names: Jessica
- family-names: Verpoort
given-names: Philipp
- family-names: Weigmann
given-names: Pascal
license: LGPL-3.0
repository-code: https://github.com/pik-piam/remind2

7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: remind2
Title: The REMIND R package (2nd generation)
Version: 1.119.1
Date: 2023-09-22
Version: 1.119.3
Date: 2023-09-28
Authors@R: c(
person("Renato", "Rodrigues", , "[email protected]", role = c("aut", "cre")),
person("Lavinia", "Baumstark", role = "aut"),
Expand Down Expand Up @@ -32,7 +32,8 @@ Authors@R: c(
person("Björn", "Sörgel", role = "aut"),
person("Mike", "Spahr", role = "aut"),
person("Jessica", "Strefler", role = "aut"),
person("Philipp", "Verpoort", role = "aut")
person("Philipp", "Verpoort", role = "aut"),
person("Pascal", "Weigmann", role = "aut")
)
Description: Contains the REMIND-specific routines for data and model
output manipulation.
Expand Down
10 changes: 9 additions & 1 deletion R/compareScenarios2.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,23 @@ compareScenarios2 <- function(
} else if (outputFormat == "rmd") {
return(.compareScenarios2Rmd(yamlParams, outputDir, outputFile))
}

# copy the template directory from the package to the outputDir because rmarkdown writes to the folder
# containing the template.
templateInOutputDir <- file.path(outputDir, "compareScenarios2", "cs2_main.Rmd")
file.copy(system.file("markdown/compareScenarios2/", package = "remind2"),
outputDir, recursive = TRUE)

rmarkdown::render(
system.file("markdown/compareScenarios2/cs2_main.Rmd", package = "remind2"),
templateInOutputDir,
intermediates_dir = outputDir,
output_dir = outputDir,
output_file = outputFile,
output_format = outputFormat,
params = yamlParams,
envir = envir,
quiet = quiet)
unlink(file.path(outputDir, "compareScenarios2"), recursive = TRUE)
}

# Copies the CompareScenarios2-Rmds to the specified location and modifies
Expand Down
8 changes: 7 additions & 1 deletion R/reportFE.R
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,8 @@ reportFE <- function(gdx, regionSubsetList = NULL,

} else {
# TODO: correct once feedstocks are calculated within the model
# The variable FE|w/o Non-energy Use|Industry currently contains Non-Energy Use. Non-Energy Use should be subtracted from this variable as soon as feedstocks are calculated within the model.")
# The variable FE|w/o Non-energy Use|Industry currently contains Non-Energy Use. Non-Energy Use should be subtracted
# from this variable as soon as feedstocks are calculated within the model.")
out <- mbind(
out,
setNames(out[, , "FE|++|Industry (EJ/yr)"], "FE|w/o Non-energy Use|Industry (EJ/yr)"),
Expand All @@ -1668,6 +1669,11 @@ reportFE <- function(gdx, regionSubsetList = NULL,
out <- add_columns(out, addnm = "FE|Non-energy Use|Industry (EJ/yr)", dim = 3.1, fill = 0)
}

# in case the current non-energy use implementation creates negative values, set them to 0
if (any(out < 0)) {
out[out < 0] <- 0
}

# add global values
out <- mbind(out,dimSums(out,dim=1))
# add other region aggregations
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The REMIND R package (2nd generation)

R package **remind2**, version **1.119.1**
R package **remind2**, version **1.119.3**

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

Expand Down Expand Up @@ -49,16 +49,16 @@ In case of questions / problems please contact Renato Rodrigues <renato.rodrigue

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

Rodrigues R, Baumstark L, Benke F, Dietrich J, Dirnaichner A, Führlich P, Giannousakis A, Hasse R, Hilaire J, Klein D, Koch J, Kowalczyk K, Levesque A, Malik A, Merfort A, Merfort L, Morena-Leiva S, Pehl M, Pietzcker R, Rauner S, Richters O, Rottoli M, Schötz C, Schreyer F, Siala K, Sörgel B, Spahr M, Strefler J, Verpoort P (2023). _remind2: The REMIND R package (2nd generation)_. R package version 1.119.1, <https://github.com/pik-piam/remind2>.
Rodrigues R, Baumstark L, Benke F, Dietrich J, Dirnaichner A, Führlich P, Giannousakis A, Hasse R, Hilaire J, Klein D, Koch J, Kowalczyk K, Levesque A, Malik A, Merfort A, Merfort L, Morena-Leiva S, Pehl M, Pietzcker R, Rauner S, Richters O, Rottoli M, Schötz C, Schreyer F, Siala K, Sörgel B, Spahr M, Strefler J, Verpoort P, Weigmann P (2023). _remind2: The REMIND R package (2nd generation)_. R package version 1.119.3, <URL: https://github.com/pik-piam/remind2>.

A BibTeX entry for LaTeX users is

```latex
@Manual{,
title = {remind2: The REMIND R package (2nd generation)},
author = {Renato Rodrigues and Lavinia Baumstark and Falk Benke and Jan Philipp Dietrich and Alois Dirnaichner and Pascal Führlich and Anastasis Giannousakis and Robin Hasse and Jérome Hilaire and David Klein and Johannes Koch and Katarzyna Kowalczyk and Antoine Levesque and Aman Malik and Anne Merfort and Leon Merfort and Simón Morena-Leiva and Michaja Pehl and Robert Pietzcker and Sebastian Rauner and Oliver Richters and Marianna Rottoli and Christof Schötz and Felix Schreyer and Kais Siala and Björn Sörgel and Mike Spahr and Jessica Strefler and Philipp Verpoort},
author = {Renato Rodrigues and Lavinia Baumstark and Falk Benke and Jan Philipp Dietrich and Alois Dirnaichner and Pascal Führlich and Anastasis Giannousakis and Robin Hasse and Jérome Hilaire and David Klein and Johannes Koch and Katarzyna Kowalczyk and Antoine Levesque and Aman Malik and Anne Merfort and Leon Merfort and Simón Morena-Leiva and Michaja Pehl and Robert Pietzcker and Sebastian Rauner and Oliver Richters and Marianna Rottoli and Christof Schötz and Felix Schreyer and Kais Siala and Björn Sörgel and Mike Spahr and Jessica Strefler and Philipp Verpoort and Pascal Weigmann},
year = {2023},
note = {R package version 1.119.1},
note = {R package version 1.119.3},
url = {https://github.com/pik-piam/remind2},
}
```

0 comments on commit af9eae9

Please sign in to comment.