Skip to content

Commit

Permalink
explicitly monitor GDPuc::convertGDP for madrat caching
Browse files Browse the repository at this point in the history
  • Loading branch information
0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q committed Oct 11, 2024
1 parent bde9e5b commit 9378419
Show file tree
Hide file tree
Showing 20 changed files with 26 additions and 0 deletions.
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
2 changes: 2 additions & 0 deletions R/UNIDO.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,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

0 comments on commit 9378419

Please sign in to comment.