Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explicitly monitor GDPuc::convertGDP for madrat caching #574

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '38731616'
ValidationKey: '38753559'
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
- 'Warning: namespace ''.*'' is not available and has been replaced'
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: 'mrremind: MadRat REMIND Input Data Package'
version: 0.193.6
date-released: '2024-10-10'
version: 0.193.7
date-released: '2024-10-11'
abstract: The mrremind packages contains data preprocessing for the REMIND model.
authors:
- family-names: Baumstark
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: mrremind
Title: MadRat REMIND Input Data Package
Version: 0.193.6
Date: 2024-10-10
Version: 0.193.7
Date: 2024-10-11
Authors@R: c(
person("Lavinia", "Baumstark", , "[email protected]", role = c("aut", "cre")),
person("Renato", "Rodrigues", role = "aut"),
Expand Down
2 changes: 2 additions & 0 deletions R/EDGE-Industry.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ calcSteel_Projections <- function(subtype = 'production',
save.plots = NULL,
China_Production = NULL) {

"!# @monitor GDPuc::convertGDP"

if (!is.null(save.plots)) {
if (!all(isTRUE(file.info(save.plots)$isdir),
448L == bitwAnd(file.info(save.plots)$mode, 448L))) {
Expand Down
4 changes: 4 additions & 0 deletions R/UNIDO.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
#' @export
readUNIDO <- function(subtype = 'INDSTAT2')
{
"!# @monitor GDPuc::convertGDP"

# define read functions for all subtypes ----
switchboard <- list(
`INDSTAT2` = function()
Expand Down Expand Up @@ -111,6 +113,8 @@ readUNIDO <- function(subtype = 'INDSTAT2')
#' @export
convertUNIDO <- function(x, subtype = 'INDSTAT2')
{
"!# @monitor GDPuc::convertGDP"

# define convert functions for all subtypes ----
switchboard <- list(
`INDSTAT2` = function(x)
Expand Down
2 changes: 2 additions & 0 deletions R/calcBP.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#' @export
#'
calcBP <- function() {
"!# @monitor GDPuc::convertGDP"

# read in emissions, capacity, generation, price ----

emissions <- readSource("BP", subtype = "Emission")
Expand Down
1 change: 1 addition & 0 deletions R/calcBiomassPrices.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#' @return Magpie object with two parameters determining linear biomass supply curve

calcBiomassPrices <- function() {
"!# @monitor GDPuc::convertGDP"

x <- readSource("MAgPIE", subtype = "supplyCurve_magpie_40")

Expand Down
1 change: 1 addition & 0 deletions R/calcCO2Prices.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
calcCO2Prices <- function() {
"!# @monitor GDPuc::convertGDP"

# read data
x <- readSource("ExpertGuess", subtype = "co2prices")
Expand Down
2 changes: 2 additions & 0 deletions R/calcCostsTradePeFinancial.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#' }
#'
calcCostsTradePeFinancial <- function() {
"!# @monitor GDPuc::convertGDP"

data <- readSource("ExpertGuess", subtype = "costsTradePeFinancial")

data <- GDPuc::convertGDP(
Expand Down
1 change: 1 addition & 0 deletions R/calcCostsWeathering.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#' }
#'
calcCostsWeathering <- function() {
"!# @monitor GDPuc::convertGDP"

costs <- readSource("Strefler", subtype = "weathering_costs")

Expand Down
1 change: 1 addition & 0 deletions R/calcDiffInvestCosts.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#' @author Aman Malik

calcDiffInvestCosts <- function(subtype) {
"!# @monitor GDPuc::convertGDP"

if (subtype == "Invest_Costs") {

Expand Down
1 change: 1 addition & 0 deletions R/calcEU_ReferenceScenario.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
calcEU_ReferenceScenario <- function() {
"!# @monitor GDPuc::convertGDP"

euRef2016 <- readSource("EU_ReferenceScenario", subtype = "2016")

Expand Down
1 change: 1 addition & 0 deletions R/calcEconometricEmiParameter.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#' }

calcEconometricEmiParameter <- function() {
"!# @monitor GDPuc::convertGDP"

# calculate parameter p3
edgar <- readSource("EDGAR", subtype = "co2") * 12 / 44 * 1e-6
Expand Down
1 change: 1 addition & 0 deletions R/calcINNOPATHS.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
calcINNOPATHS <- function() {
"!# @monitor GDPuc::convertGDP"

x <- readSource("INNOPATHS")

Expand Down
1 change: 1 addition & 0 deletions R/calcIndustry_EEK.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#' @export
calcIndustry_EEK <- function(kap) {
"!# @monitor GDPuc::convertGDP"
# setup ----
i <- log(4) / 50 # assuming 50 year lifetime of EEK
base_year <- 2015
Expand Down
1 change: 1 addition & 0 deletions R/calcJRC_IDEES.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#' @importFrom stats aggregate

calcJRC_IDEES <- function(subtype) {
"!# @monitor GDPuc::convertGDP"

subtypes <- c("Industry", "Transport", "ResCom")
if (!subtype %in% subtypes) {
Expand Down
1 change: 1 addition & 0 deletions R/calcTaxConvergence.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#' }
#'
calcTaxConvergence <- function() {
"!# @monitor GDPuc::convertGDP"

# Read tax convergence levels at specific year and final energy type
taxConvergence <- readSource("REMIND_11Regi", subtype = "taxConvergence")
Expand Down
1 change: 1 addition & 0 deletions R/calcTaxLimits.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#' }
#'
calcTaxLimits <- function(subtype) {
"!# @monitor GDPuc::convertGDP"

if (!(subtype %in% c("maxFeSubsidy", "maxPeSubsidy", "propFeSubsidy"))) {
stop("the argument subtype must be in c('maxFeSubsidy','maxPeSubsidy', 'propFeSubsidy')")
Expand Down
1 change: 1 addition & 0 deletions R/calcTaxXport.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
calcTaxXport <- function() {
"!# @monitor GDPuc::convertGDP"

x <- readSource("REMIND_11Regi", subtype = "xpres_tax")

Expand Down
1 change: 1 addition & 0 deletions R/convertDylanAusGasCost.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#' @seealso \code{\link{readSource}}

convertDylanAusGasCost <- function(x) {
"!# @monitor GDPuc::convertGDP"

x %>%
# Converting from constant 2015 Australian dollars to constant 2017 US$MER
Expand Down
2 changes: 2 additions & 0 deletions R/convertGEA2012.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#' }
#'
convertGEA2012 <- function(x, subtype) {
"!# @monitor GDPuc::convertGDP"

if (subtype == "coal") {

# Load mapping file for GEA regions to country level
Expand Down
1 change: 1 addition & 0 deletions R/convertIIASA_subs_taxes.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#' }
#'
convertIIASA_subs_taxes <- function(x, subtype) {
"!# @monitor GDPuc::convertGDP"

x <- toolCountryFill(x,
verbosity = 2, fill = 0,
Expand Down
2 changes: 2 additions & 0 deletions R/convertTransportSubisidies.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#' }
#'
convertTransportSubsidies <- function(x) {
"!# @monitor GDPuc::convertGDP"

x <- toolCountryFill(x, fill = 0, verbosity = 2) # fill countries with no data
x[is.na(x)] <- 0

Expand Down
2 changes: 2 additions & 0 deletions R/readDylanAusGasCost.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#' @seealso \code{\link{readSource}}
#'
readDylanAusGasCost <- function() {
"!# @monitor GDPuc::convertGDP"

# Dylan's gas extraction cost curve based on GSOO data on reserves and resources in 2015
# (only for Eastern gas reserves, not Western Australia!!)

Expand Down
2 changes: 2 additions & 0 deletions R/readGEA2012.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#' @importFrom dplyr relocate mutate

readGEA2012 <- function(subtype) {
"!# @monitor GDPuc::convertGDP"

EJ_2_TWyr <- 1 / 31.536
ts1 <- 5
ts2 <- 10
Expand Down
1 change: 1 addition & 0 deletions R/readIIASA_subs_taxes.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#' }
#'
readIIASA_subs_taxes <- function(subtype) {
"!# @monitor GDPuc::convertGDP"

file <- "unlinked_countries_2017_03.xlsx"

Expand Down
6 changes: 4 additions & 2 deletions R/readTransportSubsidies.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#' Read transport subsidies data
#'
#'
#' Read-in transport subsidies csv files as magclass object
#'
#'
#' @return magpie object of the transport subsidies for BEV, FCEV and PHEV (euros/car) for private and legal entities
#' @author Renato Rodrigues
#' @seealso \code{\link{readSource}}
#' @examples
#' \dontrun{ a <- readSource(type="TransportSubsidies")
#' }
readTransportSubsidies <- function() {
"!# @monitor GDPuc::convertGDP"

data <- read.csv("transportSubsidies.csv", sep = ";")
as.magpie(data, datacol = 3)
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MadRat REMIND Input Data Package

R package **mrremind**, version **0.193.6**
R package **mrremind**, version **0.193.7**

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

Expand Down Expand Up @@ -39,7 +39,7 @@ In case of questions / problems please contact Lavinia Baumstark <lavinia@pik-po

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

Baumstark L, Rodrigues R, Levesque A, Oeser J, Bertram C, Mouratiadou I, Malik A, Schreyer F, Soergel B, Rottoli M, Mishra A, Dirnaichner A, Pehl M, Giannousakis A, Klein D, Strefler J, Feldhaus L, Brecha R, Rauner S, Dietrich J, Bi S, Benke F, Weigmann P, Richters O, Hasse R, Fuchs S, Mandaroux R, Koch J (2024). _mrremind: MadRat REMIND Input Data Package_. R package version 0.193.6, <https://github.com/pik-piam/mrremind>.
Baumstark L, Rodrigues R, Levesque A, Oeser J, Bertram C, Mouratiadou I, Malik A, Schreyer F, Soergel B, Rottoli M, Mishra A, Dirnaichner A, Pehl M, Giannousakis A, Klein D, Strefler J, Feldhaus L, Brecha R, Rauner S, Dietrich J, Bi S, Benke F, Weigmann P, Richters O, Hasse R, Fuchs S, Mandaroux R, Koch J (2024). _mrremind: MadRat REMIND Input Data Package_. R package version 0.193.7, <https://github.com/pik-piam/mrremind>.

A BibTeX entry for LaTeX users is

Expand All @@ -48,7 +48,7 @@ A BibTeX entry for LaTeX users is
title = {mrremind: MadRat REMIND Input Data Package},
author = {Lavinia Baumstark and Renato Rodrigues and Antoine Levesque and Julian Oeser and Christoph Bertram and Ioanna Mouratiadou and Aman Malik and Felix Schreyer and Bjoern Soergel and Marianna Rottoli and Abhijeet Mishra and Alois Dirnaichner and Michaja Pehl and Anastasis Giannousakis and David Klein and Jessica Strefler and Lukas Feldhaus and Regina Brecha and Sebastian Rauner and Jan Philipp Dietrich and Stephen Bi and Falk Benke and Pascal Weigmann and Oliver Richters and Robin Hasse and Sophie Fuchs and Rahel Mandaroux and Johannes Koch},
year = {2024},
note = {R package version 0.193.6},
note = {R package version 0.193.7},
url = {https://github.com/pik-piam/mrremind},
}
```
Loading