Skip to content

Commit

Permalink
Merge pull request #22 from pascal-sauer/master
Browse files Browse the repository at this point in the history
allow zero weight in readGasser
  • Loading branch information
pascal-sauer authored Nov 21, 2024
2 parents 9b4708f + 5cf8934 commit e56d1ff
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '52464720'
ValidationKey: '52505712'
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: 'mrvalidation: madrat data preparation for validation purposes'
version: 2.61.8
date-released: '2024-11-13'
version: 2.61.9
date-released: '2024-11-21'
abstract: Package contains routines to prepare data for validation exercises.
authors:
- family-names: Bodirsky
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: mrvalidation
Title: madrat data preparation for validation purposes
Version: 2.61.8
Date: 2024-11-13
Version: 2.61.9
Date: 2024-11-21
Authors@R: c(
person("Benjamin Leon", "Bodirsky", , "[email protected]", role = c("aut", "cre")),
person("Stephen", "Wirth", role = "aut"),
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ importFrom(magpiesets,reporthelper)
importFrom(magpiesets,reportingnames)
importFrom(magpiesets,summationhelper)
importFrom(mrfaocore,toolFAOcombine)
importFrom(mstools,toolCell2isoCell)
importFrom(mstools,toolCoord2Isocell)
importFrom(mstools,toolGetMappingCoord2Country)
importFrom(mstools,toolIso2CellCountries)
Expand Down
2 changes: 0 additions & 2 deletions R/calcValidGrassLSUha.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#' \dontrun{
#' calcOutput("ValidGrassLSUha")
#' }
#' @importFrom mstools toolCell2isoCell

calcValidGrassLSUha <- function(datasource = "MAgPIEown") {

if (datasource == "MAgPIEown") {
Expand Down
3 changes: 0 additions & 3 deletions R/calcValidGridNutrientAWMS.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
#' }
#'
#' @importFrom magpiesets reportingnames
#' @importFrom mstools toolIso2CellCountries

calcValidGridNutrientAWMS <- function(nutrient = c("nr", "c")) {

past <- findset("past")
out <- collapseNames(calcOutput("Excretion", cellular = TRUE, attributes = "npkc",
aggregate = FALSE)[, past, ])[, , nutrient]
Expand Down
1 change: 0 additions & 1 deletion R/calcValidKcal.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#' @importFrom magpiesets reporthelper
#' @importFrom magclass getSets dimOrder
#' @importFrom mrfaocore toolFAOcombine

calcValidKcal <- function(datasource = "FAO", nutrient = "kcal", detail = TRUE) {
if (length(nutrient) > 1) {
stop("select only one nutrient")
Expand Down
3 changes: 2 additions & 1 deletion R/readGasser.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ readGasser <- function(subtype = "bookkeeping") {
rel = mappingGasser,
weight = weight[isoList, getYears(eluc), ],
from = "GasserReg",
to = "ISO.Alpha3")
to = "ISO.Alpha3",
zeroWeight = "allow")

weight <- collapseNames(readSource("FRA2020", "forest_area")[, , "landArea"])
missingWeightYears <- setdiff(getYears(eluc), getYears(weight))
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# madrat data preparation for validation purposes

R package **mrvalidation**, version **2.61.8**
R package **mrvalidation**, version **2.61.9**

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

Expand Down Expand Up @@ -39,7 +39,7 @@ In case of questions / problems please contact Benjamin Leon Bodirsky <bodirsky@

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

Bodirsky B, Wirth S, Karstens K, Humpenoeder F, Stevanovic M, Mishra A, Biewald A, Weindl I, Beier F, Chen D, Crawford M, Leip D, Molina Bacca E, Kreidenweis U, W. Yalew A, von Jeetze P, Wang X, Dietrich J, Alves M (2024). _mrvalidation: madrat data preparation for validation purposes_. doi: 10.5281/zenodo.4317826 (URL: https://doi.org/10.5281/zenodo.4317826), R package version 2.61.8, <URL: https://github.com/pik-piam/mrvalidation>.
Bodirsky B, Wirth S, Karstens K, Humpenoeder F, Stevanovic M, Mishra A, Biewald A, Weindl I, Beier F, Chen D, Crawford M, Leip D, Molina Bacca E, Kreidenweis U, W. Yalew A, von Jeetze P, Wang X, Dietrich J, Alves M (2024). _mrvalidation: madrat data preparation for validation purposes_. doi:10.5281/zenodo.4317826 <https://doi.org/10.5281/zenodo.4317826>, R package version 2.61.9, <https://github.com/pik-piam/mrvalidation>.

A BibTeX entry for LaTeX users is

Expand All @@ -48,8 +48,8 @@ A BibTeX entry for LaTeX users is
title = {mrvalidation: madrat data preparation for validation purposes},
author = {Benjamin Leon Bodirsky and Stephen Wirth and Kristine Karstens and Florian Humpenoeder and Mishko Stevanovic and Abhijeet Mishra and Anne Biewald and Isabelle Weindl and Felicitas Beier and David Chen and Michael Crawford and Debbora Leip and Edna {Molina Bacca} and Ulrich Kreidenweis and Amsalu {W. Yalew} and Patrick {von Jeetze} and Xiaoxi Wang and Jan Philipp Dietrich and Marcos Alves},
year = {2024},
note = {R package version 2.61.8},
doi = {10.5281/zenodo.4317826},
note = {R package version 2.61.9},
url = {https://github.com/pik-piam/mrvalidation},
doi = {10.5281/zenodo.4317826},
}
```

0 comments on commit e56d1ff

Please sign in to comment.