From 625e3f5d03ab13dd82cf7d1e2b14f62a176b0c5c Mon Sep 17 00:00:00 2001 From: Pascal Sauer Date: Thu, 15 Feb 2024 14:36:15 +0100 Subject: [PATCH 1/2] use numeric_version --- R/fullCELLULARMAGPIE.R | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/R/fullCELLULARMAGPIE.R b/R/fullCELLULARMAGPIE.R index f4202967..1bc5acaf 100755 --- a/R/fullCELLULARMAGPIE.R +++ b/R/fullCELLULARMAGPIE.R @@ -2,7 +2,7 @@ #' @description Function that produces the complete cellular data set required #' for running the MAgPIE model. #' -#' @param rev data revision which should be used as input (positive numeric). +#' @param rev data revision which should be used as input (numeric_version). #' @param ctype aggregation clustering type, which is a combination of a single letter, #' indicating the cluster methodology, and a number, indicating the number #' of resulting clusters. Available methodologies are @@ -31,7 +31,8 @@ #' \code{\link{readSource}},\code{\link{getCalculations}},\code{\link{calcOutput}},\code{\link{setConfig}} #' @examples #' \dontrun{ -#' retrieveData("CELLULARMAGPIE", revision = 12, mainfolder = "pathtowhereallfilesarestored") +#' retrieveData("CELLULARMAGPIE", rev = numeric_version("12"), +#' mainfolder = "pathtowhereallfilesarestored") #' } #' @importFrom madrat setConfig getConfig #' @importFrom magpiesets findset @@ -41,7 +42,7 @@ #' @importFrom ggplot2 ggsave #' @importFrom withr local_options -fullCELLULARMAGPIE <- function(rev = 0.1, dev = "", +fullCELLULARMAGPIE <- function(rev = numeric_version("0.1"), dev = "", ctype = "c200", climatetype = "MRI-ESM2-0:ssp370", lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", @@ -56,8 +57,10 @@ fullCELLULARMAGPIE <- function(rev = 0.1, dev = "", withr::local_options(magclass_sizeLimit = 1e+12) ### Version settings ### - if (rev < 4.94) stop("mrmagpie(>= 1.35.2) does not support revision below 4.94 anymore. - Please use an older snapshot/version of the library, if you need older revisions.") + if (rev < numeric_version("4.94")) { + stop("mrmagpie(>= 1.35.2) does not support revision below 4.94 anymore. ", + "Please use an older snapshot/version of the library, if you need older revisions.") + } cells <- "lpjcell" climatescen <- str_split(climatetype, ":")[[1]][2] From 2f9cc7d76f32e64dcb13c7898c59425389658e19 Mon Sep 17 00:00:00 2001 From: Pascal Sauer Date: Thu, 15 Feb 2024 14:36:41 +0100 Subject: [PATCH 2/2] build --- .buildlibrary | 4 ++-- .pre-commit-config.yaml | 2 +- CITATION.cff | 4 ++-- DESCRIPTION | 4 ++-- README.md | 8 ++++---- man/fullCELLULARMAGPIE.Rd | 7 ++++--- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index 80c51925..001b15e9 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,9 +1,9 @@ -ValidationKey: '27757180' +ValidationKey: '27793808' AutocreateReadme: yes AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' - 'Warning: namespace ''.*'' is not available and has been replaced' AcceptedNotes: - unable to verify current time -- includes the non-default packages. +- includes the non-default packages allowLinterWarnings: no diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2f134668..243f46a1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - id: mixed-line-ending - repo: https://github.com/lorenzwalthert/precommit - rev: v0.3.2.9025 + rev: v0.4.0 hooks: - id: parsable-R - id: deps-in-desc diff --git a/CITATION.cff b/CITATION.cff index ee68167d..55d4b97e 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.40.5 -date-released: '2024-02-03' +version: 1.40.6 +date-released: '2024-02-15' abstract: Provides functions for MAgPIE country and cellular input data generation. authors: - family-names: Karstens diff --git a/DESCRIPTION b/DESCRIPTION index 5fa32297..3e0a1a3c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: mrmagpie Title: madrat based MAgPIE Input Data Library -Version: 1.40.5 -Date: 2024-02-03 +Version: 1.40.6 +Date: 2024-02-15 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/README.md b/README.md index 4ae10281..130c239e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # madrat based MAgPIE Input Data Library -R package **mrmagpie**, version **1.40.5** +R package **mrmagpie**, version **1.40.6** [![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.40.5, . +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.40.6, . A BibTeX entry for LaTeX users is @@ -48,8 +48,8 @@ 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.40.5}, - doi = {10.5281/zenodo.4319612}, + note = {R package version 1.40.6}, url = {https://github.com/pik-piam/mrmagpie}, + doi = {10.5281/zenodo.4319612}, } ``` diff --git a/man/fullCELLULARMAGPIE.Rd b/man/fullCELLULARMAGPIE.Rd index 247430a6..2da062d1 100644 --- a/man/fullCELLULARMAGPIE.Rd +++ b/man/fullCELLULARMAGPIE.Rd @@ -5,7 +5,7 @@ \title{fullCELLULARMAGPIE} \usage{ fullCELLULARMAGPIE( - rev = 0.1, + rev = numeric_version("0.1"), dev = "", ctype = "c200", climatetype = "MRI-ESM2-0:ssp370", @@ -17,7 +17,7 @@ fullCELLULARMAGPIE( ) } \arguments{ -\item{rev}{data revision which should be used as input (positive numeric).} +\item{rev}{data revision which should be used as input (numeric_version).} \item{dev}{development suffix to distinguish development versions for the same data revision. This can be useful to distinguish parallel lines of development.} @@ -54,7 +54,8 @@ Function that produces the complete cellular data set required } \examples{ \dontrun{ -retrieveData("CELLULARMAGPIE", revision = 12, mainfolder = "pathtowhereallfilesarestored") +retrieveData("CELLULARMAGPIE", rev = numeric_version("12"), + mainfolder = "pathtowhereallfilesarestored") } } \seealso{