Skip to content

Commit

Permalink
Merge pull request #40 from pascal-sauer/master
Browse files Browse the repository at this point in the history
use numeric_version
  • Loading branch information
pascal-sauer authored Feb 15, 2024
2 parents a7a8df3 + 2f9cc7d commit 1ede567
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .buildlibrary
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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: '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
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: 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", , "[email protected]", role = c("aut", "cre")),
person("Jan Philipp", "Dietrich", , "[email protected]", role = "aut"),
Expand Down
13 changes: 8 additions & 5 deletions R/fullCELLULARMAGPIE.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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",
Expand All @@ -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]

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 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)

Expand Down Expand Up @@ -39,7 +39,7 @@ In case of questions / problems please contact Kristine Karstens <karstens@pik-p

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

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 <https://doi.org/10.5281/zenodo.4319612>, R package version 1.40.5, <https://github.com/pik-piam/mrmagpie>.
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 <https://doi.org/10.5281/zenodo.4319612>, R package version 1.40.6, <https://github.com/pik-piam/mrmagpie>.

A BibTeX entry for LaTeX users is

Expand All @@ -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},
}
```
7 changes: 4 additions & 3 deletions man/fullCELLULARMAGPIE.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1ede567

Please sign in to comment.