Skip to content

Commit

Permalink
Merge pull request #64 from pascal-sauer/master
Browse files Browse the repository at this point in the history
fix reporting warnings
  • Loading branch information
pascal-sauer authored Apr 8, 2024
2 parents 5ce793a + 9bb8384 commit 2856e17
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '2390387706'
ValidationKey: '2390769378'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
gamstransfer=?ignore
any::lucode2
any::covr
any::madrat
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: 'magpie4: MAgPIE outputs R package for MAgPIE version 4.x'
version: 1.206.17
date-released: '2024-04-05'
version: 1.206.18
date-released: '2024-04-08'
abstract: Common output routines for extracting results from the MAgPIE framework
(versions 4.x).
authors:
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: magpie4
Title: MAgPIE outputs R package for MAgPIE version 4.x
Version: 1.206.17
Date: 2024-04-05
Version: 1.206.18
Date: 2024-04-08
Authors@R: c(
person("Benjamin Leon", "Bodirsky", , "[email protected]", role = c("aut", "cre")),
person("Florian", "Humpenoeder", , "[email protected]", role = "aut"),
Expand Down
11 changes: 6 additions & 5 deletions R/reportTau.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
reportTau <- function(gdx) {
pt <- NULL
tau <- readGDX(gdx, "ov_tau", format = "first_found")[, , "level"]
if (any(grepl("pastr", getItems(tau, dim = 3)))) {
pt <- tau(gdx = gdx, level = "regglo", type = "pastr")
if (!is.null(pt)) {
getNames(pt) <- "Productivity|Landuse Intensity Indicator Tau managed pastures (Index)"
}
grassArea <- readGDX(gdx, "ov31_grass_area", format = "first_found", react = "silent")[, , "pastr.level"]
if (any(grepl("pastr", getItems(tau, dim = 3))) && !is.null(grassArea)) {
pt <- tau(gdx = gdx, level = "regglo", type = "pastr")
if (!is.null(pt)) {
getNames(pt) <- "Productivity|Landuse Intensity Indicator Tau managed pastures (Index)"
}
}
cr <- tau(gdx = gdx, level = "regglo", type = "crop")
getNames(cr) <- "Productivity|Landuse Intensity Indicator Tau (Index)"
Expand Down
3 changes: 1 addition & 2 deletions R/reportYieldsCropCalib.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#' @description reports potential yields after calibration
#'
#' @importFrom magpiesets reporthelper summationhelper
#' @importFrom luscale speed_aggregate
#' @export
#'
#' @param gdx GDX file
Expand All @@ -28,7 +27,7 @@ reportYieldsCropCalib <- function(gdx, detail = FALSE) {
colnames(mapping) <- "Crops_w"
mapping$Crops <- gsub("\\..*", "", mapping$Crops_w)

out <- speed_aggregate(out, rel = mapping, from = "Crops_w", to = "Crops", weight = weight, dim = 3)
out <- toolAggregate(out, rel = mapping, from = "Crops_w", to = "Crops", weight = weight, dim = 3)

} else {
out <- out
Expand Down
3 changes: 1 addition & 2 deletions R/reportYieldsCropRaw.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#' @description reports potential yields before calibration
#'
#' @importFrom magpiesets reporthelper summationhelper
#' @importFrom luscale speed_aggregate
#' @export
#'
#' @param gdx GDX file
Expand Down Expand Up @@ -30,7 +29,7 @@ reportYieldsCropRaw <- function(gdx, detail = FALSE) {
colnames(mapping) <- "Crops_w"
mapping$Crops <- gsub("\\..*", "", mapping$Crops_w)

out <- speed_aggregate(out, rel = mapping, from = "Crops_w", to = "Crops", weight = weight, dim = 3)
out <- toolAggregate(out, rel = mapping, from = "Crops_w", to = "Crops", weight = weight, dim = 3)

} else {
out <- out
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MAgPIE outputs R package for MAgPIE version 4.x

R package **magpie4**, version **1.206.17**
R package **magpie4**, version **1.206.18**

[![CRAN status](https://www.r-pkg.org/badges/version/magpie4)](https://cran.r-project.org/package=magpie4) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1158582.svg)](https://doi.org/10.5281/zenodo.1158582) [![R build status](https://github.com/pik-piam/magpie4/workflows/check/badge.svg)](https://github.com/pik-piam/magpie4/actions) [![codecov](https://codecov.io/gh/pik-piam/magpie4/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/magpie4) [![r-universe](https://pik-piam.r-universe.dev/badges/magpie4)](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 **magpie4** in publications use:

Bodirsky B, Humpenoeder F, Dietrich J, Stevanovic M, Weindl I, Karstens K, Wang X, Mishra A, Beier F, Breier J, Yalew A, Chen D, Biewald A, Wirth S, von Jeetze P, Leip D, Crawford M, Alves M (2024). _magpie4: MAgPIE outputs R package for MAgPIE version 4.x_. doi:10.5281/zenodo.1158582 <https://doi.org/10.5281/zenodo.1158582>, R package version 1.206.17, <https://github.com/pik-piam/magpie4>.
Bodirsky B, Humpenoeder F, Dietrich J, Stevanovic M, Weindl I, Karstens K, Wang X, Mishra A, Beier F, Breier J, Yalew A, Chen D, Biewald A, Wirth S, von Jeetze P, Leip D, Crawford M, Alves M (2024). _magpie4: MAgPIE outputs R package for MAgPIE version 4.x_. doi:10.5281/zenodo.1158582 <https://doi.org/10.5281/zenodo.1158582>, R package version 1.206.18, <https://github.com/pik-piam/magpie4>.

A BibTeX entry for LaTeX users is

Expand All @@ -48,8 +48,8 @@ A BibTeX entry for LaTeX users is
title = {magpie4: MAgPIE outputs R package for MAgPIE version 4.x},
author = {Benjamin Leon Bodirsky and Florian Humpenoeder and Jan Philipp Dietrich and Miodrag Stevanovic and Isabelle Weindl and Kristine Karstens and Xiaoxi Wang and Abhijeet Mishra and Felicitas Beier and Jannes Breier and Amsalu Woldie Yalew and David Chen and Anne Biewald and Stephen Wirth and Patrick {von Jeetze} and Debbora Leip and Michael Crawford and Marcos Alves},
year = {2024},
note = {R package version 1.206.17},
doi = {10.5281/zenodo.1158582},
note = {R package version 1.206.18},
url = {https://github.com/pik-piam/magpie4},
doi = {10.5281/zenodo.1158582},
}
```

0 comments on commit 2856e17

Please sign in to comment.