Skip to content

Commit

Permalink
remove unused gdx_ref parameter from reportLCOE
Browse files Browse the repository at this point in the history
  • Loading branch information
fbenke-pik committed Nov 5, 2024
1 parent 17ac437 commit d58cb1a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
7 changes: 3 additions & 4 deletions R/convGDX2MIF_LCOE.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#'
#'
#' @param gdx a GDX as created by readGDX, or the file name of a gdx
#' @param gdx_ref a GDX as created by readGDX of the reference run
#' @param file name of the mif file which will be written, if no name is
#' provided a magpie object containing all the reporting information is
#' returned
Expand All @@ -15,19 +14,19 @@
#' @author Lavinia Baumstark
#' @examples
#' \dontrun{
#' convGDX2MIF(gdx, gdx_ref, file = "REMIND_generic_LCOE.csv", scenario = "default")
#' convGDX2MIF_LCOE(gdx, file = "REMIND_generic_LCOE.csv", scenario = "default")
#' }
#'
#' @export
#' @importFrom gdx readGDX
#' @importFrom magclass mbind write.report
#' @importFrom utils write.table

convGDX2MIF_LCOE <- function(gdx, gdx_ref = NULL, file = NULL, scenario = "default",
convGDX2MIF_LCOE <- function(gdx, file = NULL, scenario = "default",
t = c(seq(2005, 2060, 5), seq(2070, 2110, 10), 2130, 2150)) {
# make the reporting
output <- NULL
output <- mbind(output, reportLCOE(gdx = gdx, gdx_ref = gdx_ref)[, t, ])
output <- mbind(output, reportLCOE(gdx = gdx)[, t, ])

# write the LCOE.mif or give back the magpie object output
if (!is.null(file)) {
Expand Down
5 changes: 1 addition & 4 deletions R/reportLCOE.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
#' Can be either "average" (returns only average LCOE),
#' "marginal" (returns only marginal LCOE), "both" (returns marginal and average LCOE) and
#' and "marginal detail" (returns table to trace back how marginal LCOE are calculated).
#' @param gdx_ref a GDX object as created by readGDX, or the path to a gdx of the reference run.
#' It is used to guarantee consistency before 'cm_startyear' for capacity and investment variables
#' using time averaging.
#' @return MAgPIE object - LCOE calculated by model post-processing.
#' Two types a) standing system LCOE b) new plant LCOE.
#' @author Felix Schreyer, Robert Pietzcker, Lavinia Baumstark
Expand All @@ -39,7 +36,7 @@
#' @importFrom quitte as.quitte overwrite getRegs getPeriods
#' @importFrom tidyr spread gather expand fill

reportLCOE <- function(gdx, output.type = "both", gdx_ref = NULL) {
reportLCOE <- function(gdx, output.type = "both") {
# test whether output.type defined
if (!output.type %in% c("marginal", "average", "both", "marginal detail")) {
print("Unknown output type. Please choose either marginal, average, both or marginal detail.")
Expand Down
5 changes: 1 addition & 4 deletions man/convGDX2MIF_LCOE.Rd

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

6 changes: 1 addition & 5 deletions man/reportLCOE.Rd

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

0 comments on commit d58cb1a

Please sign in to comment.