From 0f43202901f7b7c8f739fa6ff5199f0d9dc4b4a6 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 30 Sep 2024 13:28:17 +0200 Subject: [PATCH] bugfix warning --- .buildlibrary | 2 +- CITATION.cff | 4 ++-- DESCRIPTION | 4 ++-- R/calcPastrTauHist.R | 6 +++--- README.md | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index 98c494c4..9b50ed1f 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '30386538' +ValidationKey: '30433912' AutocreateReadme: yes AcceptedWarnings: - 'Warning: package .* was built under R version' diff --git a/CITATION.cff b/CITATION.cff index 667469f8..38359129 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -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: 'mrmagpie: madrat based MAgPIE Input Data Library' -version: 1.52.1 -date-released: '2024-09-12' +version: 1.52.2 +date-released: '2024-09-30' abstract: Provides functions for MAgPIE country and cellular input data generation. authors: - family-names: Karstens diff --git a/DESCRIPTION b/DESCRIPTION index 3a412ba8..b6fa4e76 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: mrmagpie Title: madrat based MAgPIE Input Data Library -Version: 1.52.1 -Date: 2024-09-12 +Version: 1.52.2 +Date: 2024-09-30 Authors@R: c( person("Kristine", "Karstens", , "karstens@pik-potsdam.de", role = c("aut", "cre")), person("Jan Philipp", "Dietrich", , "dietrich@pik-potsdam.de", role = "aut"), diff --git a/R/calcPastrTauHist.R b/R/calcPastrTauHist.R index 89b29777..a5f06db0 100644 --- a/R/calcPastrTauHist.R +++ b/R/calcPastrTauHist.R @@ -57,7 +57,7 @@ calcPastrTauHist <- function(past_mngmt = "mdef", cells = "lpjcell") { # nolint # mapping cell2reg <- toolGetMapping("CountryToCellMapping.csv", type = "cell", where = "mappingfolder") - yref <- toolAggregate(yref, rel = cell2reg, weight = yrefWeights, + yref <- toolAggregate(yref, rel = cell2reg, weight = yrefWeights + 10^-10, from = "celliso", to = "iso") } else if (cells == "lpjcell") { # coordinate-to-cell mapping @@ -66,7 +66,7 @@ calcPastrTauHist <- function(past_mngmt = "mdef", cells = "lpjcell") { # nolint yref <- collapseDim(yref, dim = 1.3) yrefWeights <- collapseDim(yrefWeights, dim = 1.3) # country-level grassland yields - yref <- toolAggregate(yref, rel = coord2iso, weight = yrefWeights, + yref <- toolAggregate(yref, rel = coord2iso, weight = yrefWeights + 10^-10, from = "coords", to = "iso") } else { stop("Please select cells magpiecell or lpjcell") @@ -80,7 +80,7 @@ calcPastrTauHist <- function(past_mngmt = "mdef", cells = "lpjcell") { # nolint # replacing unrealistic high tau values by regional averages regMap <- toolGetMapping("regionmappingH12.csv", type = "cell", where = "madrat") - tReg <- toolAggregate(t, rel = regMap, weight = area, from = "CountryCode", to = "RegionCode") + tReg <- toolAggregate(t, rel = regMap, weight = area + 10^-10, from = "CountryCode", to = "RegionCode") regions <- regMap$RegionCode names(regions) <- regMap[, "CountryCode"] diff --git a/README.md b/README.md index 3023ee33..f18e7963 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # madrat based MAgPIE Input Data Library -R package **mrmagpie**, version **1.52.1** +R package **mrmagpie**, version **1.52.2** [![CRAN status](https://www.r-pkg.org/badges/version/mrmagpie)](https://cran.r-project.org/package=mrmagpie) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4319612.svg)](https://doi.org/10.5281/zenodo.4319612) [![R build status](https://github.com/pik-piam/mrmagpie/workflows/check/badge.svg)](https://github.com/pik-piam/mrmagpie/actions) [![codecov](https://codecov.io/gh/pik-piam/mrmagpie/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/mrmagpie) [![r-universe](https://pik-piam.r-universe.dev/badges/mrmagpie)](https://pik-piam.r-universe.dev/builds) @@ -39,7 +39,7 @@ In case of questions / problems please contact Kristine Karstens , R package version 1.52.1, . +Karstens K, Dietrich J, Chen D, Windisch M, Alves M, Beier F, Köberle A, v. Jeetze P, Mishra A, Humpenoeder F, Sauer P (2024). _mrmagpie: madrat based MAgPIE Input Data Library_. doi:10.5281/zenodo.4319612 , R package version 1.52.2, . A BibTeX entry for LaTeX users is @@ -48,7 +48,7 @@ A BibTeX entry for LaTeX users is title = {mrmagpie: madrat based MAgPIE Input Data Library}, author = {Kristine Karstens and Jan Philipp Dietrich and David Chen and Michael Windisch and Marcos Alves and Felicitas Beier and Alexandre Köberle and Patrick {v. Jeetze} and Abhijeet Mishra and Florian Humpenoeder and Pascal Sauer}, year = {2024}, - note = {R package version 1.52.1}, + note = {R package version 1.52.2}, url = {https://github.com/pik-piam/mrmagpie}, doi = {10.5281/zenodo.4319612}, }