Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
emolinab committed Oct 25, 2023
1 parent 4b0bddf commit f948da4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '2342476500'
ValidationKey: '2343092205'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ jobs:
- name: Test coverage
shell: Rscript {0}
run: covr::codecov(quiet = FALSE)
run: |
nonDummyTests <- setdiff(list.files("./tests/testthat/"), c("test-dummy.R", "_snaps"))
if(length(nonDummyTests) > 0) covr::codecov(quiet = FALSE)
env:
NOT_CRAN: "true"
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.192.10
date-released: '2023-10-20'
version: 1.192.11
date-released: '2023-10-25'
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.192.10
Date: 2023-10-20
Version: 1.192.11
Date: 2023-10-25
Authors@R: c(
person("Benjamin Leon", "Bodirsky", , "[email protected]", role = c("aut", "cre")),
person("Florian", "Humpenoeder", , "[email protected]", role = "aut"),
Expand Down
5 changes: 3 additions & 2 deletions R/costsProductionCrops.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#' @importFrom gdx readGDX out
#' @importFrom magclass mbind dimSums collapseNames
#' @importFrom magpiesets findset
#' @importFrom madrat toolAggregate
#' @examples
#' \dontrun{
#' x <- costsProductionCrops(gdx)
Expand All @@ -31,14 +32,14 @@ costsProductionCrops <- function(gdx, file = NULL, level = "regglo", type = "inv

factorInvestment <- if (type == "investment") (int_rate) / (1 + int_rate) else 1

if (type == "annuity") {

t <- getYears(int_rate, as.integer = TRUE)
t_step <- t - c(1990, t[seq_len(length(t))[1:(length(t) - 1)]])
t_sm <- int_rate
for (y in seq_len(length(getYears(t_sm)))) {
t_sm[, y, ] <- t_step[y]
}
}



factor <- if (type == "investment") factorInvestment * t_sm else t_sm
Expand Down
6 changes: 3 additions & 3 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.192.10**
R package **magpie4**, version **1.192.11**

[![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 (2023). _magpie4: MAgPIE outputs R package for MAgPIE version 4.x_. doi: 10.5281/zenodo.1158582 (URL: https://doi.org/10.5281/zenodo.1158582), R package version 1.192.10, <URL: 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 (2023). _magpie4: MAgPIE outputs R package for MAgPIE version 4.x_. doi: 10.5281/zenodo.1158582 (URL: https://doi.org/10.5281/zenodo.1158582), R package version 1.192.11, <URL: https://github.com/pik-piam/magpie4>.

A BibTeX entry for LaTeX users is

Expand All @@ -48,7 +48,7 @@ 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 = {2023},
note = {R package version 1.192.10},
note = {R package version 1.192.11},
doi = {10.5281/zenodo.1158582},
url = {https://github.com/pik-piam/magpie4},
}
Expand Down

0 comments on commit f948da4

Please sign in to comment.