Skip to content

Commit

Permalink
always name data dimension 'variable' in report functions
Browse files Browse the repository at this point in the history
  • Loading branch information
orichters committed Sep 25, 2023
1 parent 135e96c commit 097e1e2
Show file tree
Hide file tree
Showing 21 changed files with 26 additions and 23 deletions.
1 change: 1 addition & 0 deletions R/reportCapacity.R
Original file line number Diff line number Diff line change
Expand Up @@ -316,5 +316,6 @@ reportCapacity <- function(gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5
if (!is.null(regionSubsetList))
tmp <- mbind(tmp, calc_regionSubset_sums(tmp, regionSubsetList))

getSets(tmp)[3] <- "variable"
return(tmp)
}
1 change: 1 addition & 0 deletions R/reportCapitalStock.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,6 @@ reportCapitalStock <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),se
if (!is.null(regionSubsetList))
tmp <- mbind(tmp, calc_regionSubset_sums(tmp, regionSubsetList))

getSets(tmp)[3] <- "variable"
return(tmp)
}
3 changes: 2 additions & 1 deletion R/reportCosts.R
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ reportCosts <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060,
# add other region aggregations
if (!is.null(regionSubsetList))
tmp <- mbind(tmp, calc_regionSubset_sums(tmp, regionSubsetList))


getSets(tmp)[3] <- "variable"
return(tmp)
}
1 change: 1 addition & 0 deletions R/reportCrossVariables.R
Original file line number Diff line number Diff line change
Expand Up @@ -477,5 +477,6 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL,
could not be calculated for this regional resolution")
}

getSets(out)[3] <- "variable"
return(out)
}
5 changes: 1 addition & 4 deletions R/reportEmi.R
Original file line number Diff line number Diff line change
Expand Up @@ -2524,9 +2524,6 @@ reportEmi <- function(gdx, output = NULL, regionSubsetList = NULL, t = c(seq(200

out <- mbind(out, out.cumul)




getSets(out)[3] <- "variable"
return(out)

}
1 change: 1 addition & 0 deletions R/reportEmiAirPol.R
Original file line number Diff line number Diff line change
Expand Up @@ -618,5 +618,6 @@ reportEmiAirPol <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),seq(2

} else {stop("not allowed AP-realization")}

getSets(out)[3] <- "variable"
return(out)
}
1 change: 1 addition & 0 deletions R/reportEmployment.R
Original file line number Diff line number Diff line change
Expand Up @@ -264,5 +264,6 @@ remFilter <- remFilter[, , c("New Cap|Electricity|Hydro", "Cap|Electricity|Hydro

jobs <- mbind(jobsCi, jobsOm, jobsProd, jobsManf)

getSets(jobs)[3] <- "variable"
return(jobs)
}
1 change: 1 addition & 0 deletions R/reportEnergyInvestment.R
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,6 @@ reportEnergyInvestment <- function(gdx, regionSubsetList = NULL, t = c(seq(2005,
if (!is.null(regionSubsetList))
tmp <- mbind(tmp, calc_regionSubset_sums(tmp, regionSubsetList))

getSets(tmp)[3] <- "variable"
return(tmp)
}
1 change: 1 addition & 0 deletions R/reportExtraction.R
Original file line number Diff line number Diff line change
Expand Up @@ -282,5 +282,6 @@ grades[is.na(grades)] <- 0
if (!is.null(regionSubsetList))
out <- mbind(out, calc_regionSubset_sums(out, regionSubsetList))

getSets(out)[3] <- "variable"
return(out)
}
1 change: 1 addition & 0 deletions R/reportFE.R
Original file line number Diff line number Diff line change
Expand Up @@ -1741,5 +1741,6 @@ reportFE <- function(gdx, regionSubsetList = NULL,
)
}

getSets(out)[3] <- "variable"
return(out)
}
7 changes: 1 addition & 6 deletions R/reportLCOE.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Read in GDX and calculate LCOE reporting used in convGDX2MIF_LCOE.
#'
#' This function provides a post-processing calculation of LCOE (Levelized Cost of Energy) for energy conversion technologies in REMIND.
#' In incluldes most technologies that generate secondary energy and the distribution technologies which convert secondary energy to final energy.
#' It includes most technologies that generate secondary energy and the distribution technologies which convert secondary energy to final energy.
#' This script calculates two different types of LCOE: average LCOE (standing system) and marginal LCOE (new plant).
#' The average LCOE reflect the total cost incurred by the technology deployment in a specific time step divided by its energy output.
#' The marginal LCOE estimate the per-unit lifetime cost of the output if the model added another capacity of that technology in the respective time step.
Expand Down Expand Up @@ -1599,8 +1599,3 @@ reportLCOE <- function(gdx, output.type = "both"){

return(LCOE.out)
}





1 change: 1 addition & 0 deletions R/reportMacroEconomy.R
Original file line number Diff line number Diff line change
Expand Up @@ -403,5 +403,6 @@ reportMacroEconomy <- function(gdx, regionSubsetList = NULL,
}
# add interest rate
out <- mbind(out, inteRate)
getSets(out)[3] <- "variable"
return(out)
}
3 changes: 2 additions & 1 deletion R/reportPE.R
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ reportPE <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),seq(2070,211
# add other region aggregations
if (!is.null(regionSubsetList))
out <- mbind(out, calc_regionSubset_sums(out, regionSubsetList))


getSets(out)[3] <- "variable"
return(out)
}
3 changes: 2 additions & 1 deletion R/reportPolicyCosts.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ reportPolicyCosts <- function(gdx,gdx_ref,regionSubsetList=NULL,t=c(seq(2005,206
# add other region aggregations
if (!is.null(regionSubsetList))
tmp <- mbind(tmp, calc_regionSubset_sums(tmp, regionSubsetList))


getSets(tmp)[3] <- "variable"
return(tmp)
}
1 change: 1 addition & 0 deletions R/reportPrices.R
Original file line number Diff line number Diff line change
Expand Up @@ -1129,5 +1129,6 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL,
# out <- mbind(out, tmp2)
# }

getSets(out)[3] <- "variable"
return(out)
}
2 changes: 1 addition & 1 deletion R/reportSDPVariables.R
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,6 @@ reportSDPVariables <- function(
output <- mbind(output,addUEperCapForBuildings(output))
output <- mbind(output,addIntensityUE(output))


getSets(output)[3] <- "variable"
return(output)
}
1 change: 1 addition & 0 deletions R/reportSE.R
Original file line number Diff line number Diff line change
Expand Up @@ -490,5 +490,6 @@ reportSE <- function(gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq
if (!is.null(regionSubsetList))
out <- mbind(out, calc_regionSubset_sums(out, regionSubsetList))

getSets(out)[3] <- "variable"
return(out)
}
1 change: 1 addition & 0 deletions R/reportTax.R
Original file line number Diff line number Diff line change
Expand Up @@ -312,5 +312,6 @@ reportTax <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060,5)
out["GLO",,vars] <- NA
out[names(regionSubsetList),,vars] <- NA

getSets(out)[3] <- "variable"
return(out)
}
1 change: 1 addition & 0 deletions R/reportTechnology.R
Original file line number Diff line number Diff line change
Expand Up @@ -385,5 +385,6 @@ reportTechnology <- function(gdx, output = NULL, regionSubsetList = NULL, t = c(

tmp[is.na(tmp)] <- 0 # tmp is NA if weight is zero for all regions within the GLO or the specific region aggregation. Therefore, we replace all NAs with zeros.

getSets(tmp)[3] <- "variable"
return(tmp)
}
11 changes: 3 additions & 8 deletions R/reportTrade.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,8 @@ reportTrade <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),seq(2070,
tmp <- mbind(tmp,setNames(trade[,,"perm"] * price[,,"perm"] * 1000, "Trade|Emi Allowances|Value (billion US$2005/yr)"))
tmp <- mbind(tmp,setNames(dimSums( trade[,,set_trade] * price[,,set_trade],dim = 3) * 1000, "Trade|All|Value (billion US$2005/yr)"))
tmp <- mbind(tmp,setNames(dimSums( trade[,,set_trade] * price[,,set_trade],dim = 3), "Current Account (billion US$2005/yr)"))





# rename dimensions in the magpie object
names(dimnames(tmp))[3] = 'variable'


# rename dimensions in the magpie object
getSets(tmp)[3] <- "variable"
return(tmp)
}
2 changes: 1 addition & 1 deletion man/reportLCOE.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 097e1e2

Please sign in to comment.