Skip to content

Commit

Permalink
Merge pull request #108 from johanneskoch94/main
Browse files Browse the repository at this point in the history
Move calcRatioPPP2MER to mrremind.
  • Loading branch information
johanneskoch94 authored Jan 28, 2025
2 parents ae375c5 + 25b16aa commit 6165988
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '10057500'
ValidationKey: '12069600'
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: 'mrdrivers: Create GDP and Population Scenarios'
version: 5.0.0
date-released: '2025-01-27'
version: 6.0.0
date-released: '2025-01-28'
abstract: Create GDP and population scenarios This package constructs the GDP and
population scenarios used as drivers in both the REMIND and MAgPIE models.
authors:
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: mrdrivers
Type: Package
Title: Create GDP and Population Scenarios
Version: 5.0.0
Version: 6.0.0
Authors@R: c(person(given = "Johannes",
family = "Koch",
email = "[email protected]",
Expand Down Expand Up @@ -44,6 +44,6 @@ Suggests:
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Date: 2025-01-27
Date: 2025-01-28
Config/testthat/edition: 3
VignetteBuilder: knitr
31 changes: 0 additions & 31 deletions R/calcRatioPPP2MER.R

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Create GDP and Population Scenarios

R package **mrdrivers**, version **5.0.0**
R package **mrdrivers**, version **6.0.0**

[![CRAN status](https://www.r-pkg.org/badges/version/mrdrivers)](https://cran.r-project.org/package=mrdrivers) [![R build status](https://pik-piam.github.io/mrdrivers/workflows/check/badge.svg)](https://pik-piam.github.io/mrdrivers/actions) [![codecov](https://codecov.io/gh/mrdrivers/branch/master/graph/badge.svg)](https://app.codecov.io/gh/mrdrivers) [![r-universe](https://pik-piam.r-universe.dev/badges/mrdrivers)](https://pik-piam.r-universe.dev/builds)

Expand Down Expand Up @@ -100,18 +100,18 @@ In case of questions / problems please contact Johannes Koch <jokoch@pik-potsdam

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

Koch J, Soergel B, Leip D, Benke F, Dietrich J (2025). "mrdrivers: Create GDP and Population Scenarios." Version: 5.0.0, <https://pik-piam.github.io/mrdrivershttps://github.com/pik-piam/mrdrivers>.
Koch J, Soergel B, Leip D, Benke F, Dietrich J (2025). "mrdrivers: Create GDP and Population Scenarios." Version: 6.0.0, <https://pik-piam.github.io/mrdrivershttps://github.com/pik-piam/mrdrivers>.

A BibTeX entry for LaTeX users is

```latex
@Misc{,
title = {mrdrivers: Create GDP and Population Scenarios},
author = {Johannes Koch and Bjoern Soergel and Deborra Leip and Falk Benke and Jan Philipp Dietrich},
date = {2025-01-27},
date = {2025-01-28},
year = {2025},
url = {https://pik-piam.github.io/mrdrivers},
url = {https://github.com/pik-piam/mrdrivers},
note = {Version: 5.0.0},
note = {Version: 6.0.0},
}
```
30 changes: 0 additions & 30 deletions man/calcRatioPPP2MER.Rd

This file was deleted.

20 changes: 0 additions & 20 deletions tests/testthat/test-03-calcOutput_sets.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ test_that("set names", {
expectCorrectSetNames(calcOutput("GDPpcFuture"))
expectCorrectSetNames(calcOutput("GDP", extension2150 = "none"))
expectCorrectSetNames(calcOutput("GDPpc", extension2150 = "none"))
# Want to keep: expectCorrectSetNames(calcOutput("RatioPPP2MER"))
})


Expand Down Expand Up @@ -184,22 +183,3 @@ test_that("GDPpc factored by its weight is equal to GDP, in MER", {
comment(y) <- NULL
expect_equal(x, y)
})

test_that("ppp2mer is consistent with GDP in PPP and MER", {
gdp1 <- calcOutput("GDP", unit = "constant 2017 US$MER", aggregate = FALSE)
gdp2 <- calcOutput("GDP", unit = "constant 2017 Int$PPP", aggregate = FALSE)
ppp2merDef <- calcOutput("RatioPPP2MER", aggregate = FALSE)

diff <- gdp1 / gdp2 - ppp2merDef

expect_lt(max(diff), 1e-12)

# On regional level
gdp1 <- calcOutput("GDP", unit = "constant 2017 US$MER")
gdp2 <- calcOutput("GDP", unit = "constant 2017 Int$PPP")
ppp2merDef <- calcOutput("RatioPPP2MER")

diff <- gdp1 / gdp2 - ppp2merDef

expect_lt(max(diff[, 2020, ]), 1e-2)
})
4 changes: 0 additions & 4 deletions tests/testthat/test-09-snaphsots.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,3 @@ test_that("Default calcOutput Urban calls", {
test_that("Default calcOutput Labour calls", {
expect_snapshot_value(fh(calcOutput("Labour")), style = "json2")
})

test_that("Default calcOutput RatioPPP2MER call", {
expect_snapshot_value(calcOutput("RatioPPP2MER"), style = "json2")
})

0 comments on commit 6165988

Please sign in to comment.