Skip to content

Commit

Permalink
Merge pull request #461 from pweigmann/reportFE
Browse files Browse the repository at this point in the history
Set FE|Non-energy use variables to zero if they have negative values
  • Loading branch information
pweigmann authored Sep 28, 2023
2 parents c11cd64 + 9f67e60 commit 411680b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '219654192'
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.2
date-released: '2023-09-26'
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.2
Date: 2023-09-26
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
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.2**
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.2, <URL: 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.2},
note = {R package version 1.119.3},
url = {https://github.com/pik-piam/remind2},
}
```

0 comments on commit 411680b

Please sign in to comment.