Skip to content

Commit

Permalink
bugfix type
Browse files Browse the repository at this point in the history
  • Loading branch information
flohump committed Jul 4, 2024
1 parent 6474ce0 commit 14b4a84
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '30119291'
ValidationKey: '30140712'
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: 'mrmagpie: madrat based MAgPIE Input Data Library'
version: 1.51.3
date-released: '2024-07-03'
version: 1.51.4
date-released: '2024-07-04'
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.51.3
Date: 2024-07-03
Version: 1.51.4
Date: 2024-07-04
Authors@R: c(
person("Kristine", "Karstens", , "[email protected]", role = c("aut", "cre")),
person("Jan Philipp", "Dietrich", , "[email protected]", role = "aut"),
Expand Down
8 changes: 4 additions & 4 deletions R/readGPM2.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' @title readGPM2
#' @description read peatland area from GPM2
#' @param type resolution ("1km" or "500m")
#' @param subtype resolution ("1km" or "500m")
#' @return List of magpie objects with results on cellular level, weight, unit and description.
#' @author Florian Humpenoeder
#' @examples
Expand All @@ -9,13 +9,13 @@
#' }
#' @importFrom magclass as.magpie
#' @importFrom mstools toolGetMappingCoord2Country
readGPM2 <- function(type = "1km") {
readGPM2 <- function(subtype = "1km") {
previousOptions <- terra::terraOptions(print = FALSE)
terra::terraOptions(tempdir = withr::local_tempdir(tmpdir = getConfig("tmpfolder")),
todisk = FALSE, memfrac = 0.5)
withr::defer(do.call(terra::terraOptions, previousOptions))

if (type == "1km") {
if (subtype == "1km") {
# read-in file
r <- terra::rast("peatMAY22_1x1_mw_RUS30.tif")

Expand All @@ -35,7 +35,7 @@ readGPM2 <- function(type = "1km") {
# on the cluster (method = "sum" is the problem)
r3 <- terra::aggregate(a, fact = 48, fun = "sum", na.rm = TRUE)

} else if (type == "500m") {
} else if (subtype == "500m") {
# read-in file
r <- terra::vrt(list.files("500m", full.names = TRUE, pattern = ".tif$"), "500m/GPM2.0_500m.vrt", overwrite = TRUE)
crs(r) <- "+proj=moll"
Expand Down
6 changes: 3 additions & 3 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.51.3**
R package **mrmagpie**, version **1.51.4**

[![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.51.3, <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.51.4, <https://github.com/pik-piam/mrmagpie>.

A BibTeX entry for LaTeX users is

Expand All @@ -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.51.3},
note = {R package version 1.51.4},
url = {https://github.com/pik-piam/mrmagpie},
doi = {10.5281/zenodo.4319612},
}
Expand Down
4 changes: 2 additions & 2 deletions man/readGPM2.Rd

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

0 comments on commit 14b4a84

Please sign in to comment.