Skip to content

Commit

Permalink
bring back option to set gdx path in EDGE Transport SA
Browse files Browse the repository at this point in the history
  • Loading branch information
fbenke-pik committed Dec 13, 2024
1 parent 4f6189b commit 616be95
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '42559986'
ValidationKey: '42568470'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ message: If you use this software, please cite it using the metadata from this f
type: software
title: 'edgeTransport: Prepare EDGE Transport Data for the REMIND model'
version: 2.12.1
date-released: '2024-12-09'
date-released: '2024-12-13'
abstract: EDGE-T is a fork of the GCAM transport module https://jgcri.github.io/gcam-doc/energy.html#transportation
with a high level of detail in its representation of technological and modal options.
It is a partial equilibrium model with a nested multinomial logit structure and
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.2
VignetteBuilder: knitr
Date: 2024-12-09
Date: 2024-12-13
Config/testthat/edition: 3
Imports:
rmndt,
Expand Down
3 changes: 3 additions & 0 deletions R/calcEdgeTransportSA.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#' @param isICEban optional enabling of ICE ban
#' @param demScen Demand scenario, used to apply reduction factors on total demands from the regression
#' @param outputFolder Path to folder for storing output data
#' @param gdxPath Path to a GDX file to load price signals from a REMIND run
#' @param isStored Optional saving of intermediate RDS files
#' @param isTransportReported Optional transport reporting in MIF format
#' @param isTransportExtendedReported Optional extension of transport reporting providing more detailed variables
Expand All @@ -23,6 +24,7 @@ calcEdgeTransportSA <- function(SSPscen,
transportPolScen,
isICEban = FALSE,
demScen = "default",
gdxPath = NULL,
outputFolder = NULL,
isStored = FALSE,
isTransportReported = TRUE,
Expand All @@ -35,6 +37,7 @@ calcEdgeTransportSA <- function(SSPscen,
transportPolScen,
isICEban,
demScen,
gdxPath,
outputFolder,
isStored,
isTransportReported,
Expand Down
5 changes: 4 additions & 1 deletion R/toolEdgeTransportSA.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#' @param transportPolScen EDGE-T transport policy scenario
#' @param isICEban optional enabling of ICE ban
#' @param demScen Demand scenario, used to apply reduction factors on total demands from the regression
#' @param gdxPath Path to a GDX file to load price signals from a REMIND run
#' @param outputFolder Path to folder for storing output data
#' @param isStored Optional saving of intermediate RDS files
#' @param isTransportReported Optional transport reporting in MIF format
Expand All @@ -24,6 +25,7 @@ toolEdgeTransportSA <- function(SSPscen,
transportPolScen,
isICEban = FALSE,
demScen = "default",
gdxPath = NULL,
outputFolder = NULL,
isStored = TRUE,
isTransportReported = TRUE,
Expand All @@ -45,7 +47,7 @@ toolEdgeTransportSA <- function(SSPscen,
########################################################
if (is.null(outputFolder) & isStored) stop("Please provide an outputfolder to store your results")

inputs <- toolLoadInputs(SSPscen, transportPolScen, demScen, hybridElecShare)
inputs <- toolLoadInputs(SSPscen, transportPolScen, demScen, gdxPath, hybridElecShare)

helpers <- inputs$helpers
genModelPar <- inputs$genModelPar
Expand Down Expand Up @@ -224,6 +226,7 @@ toolEdgeTransportSA <- function(SSPscen,
SSPscen = SSPscen,
transportPolScen = transportPolScen,
demScen = demScen,
gdxPath = gdxPath,
hybridElecShare = hybridElecShare,
histPrefs = histPrefs,
fleetSizeAndComposition = fleetSizeAndComposition,
Expand Down
5 changes: 3 additions & 2 deletions R/toolLoadInputs.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
#' @param SSPscen SSP or SDP scenario
#' @param transportPolScen EDGE-T transport policy scenario
#' @param demScen Demand scenario, used to apply reduction factors on total demands from the regression
#' @param gdxPath Path to a GDX file to load price signals from a REMIND run
#' @param hybridElecShare Share of electricity in Hybrid electric vehicles
#' @returns list with different input data sets
#' @import data.table
#' @export

toolLoadInputs <- function(SSPscen, transportPolScen, demScen, hybridElecShare) {
toolLoadInputs <- function(SSPscen, transportPolScen, demScen, gdxPath, hybridElecShare) {

### load inputs ------------------------------------------------------------

Expand Down Expand Up @@ -47,7 +48,7 @@ toolLoadInputs <- function(SSPscen, transportPolScen, demScen, hybridElecShare)
mrdriversData <- toolLoadmrdriversData(SSPscen, helpers)

## from REMIND
REMINDfuelCosts <- toolLoadREMINDfuelCosts(gdxPath = NULL, hybridElecShare, helpers)
REMINDfuelCosts <- toolLoadREMINDfuelCosts(gdxPath, hybridElecShare, helpers)

# from mrremind (soon to be replaced by mrtransport data)
mrremindData <- toolLoadmrremindData(helpers)
Expand Down
3 changes: 3 additions & 0 deletions man/EdgeTransportSA.Rd

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

3 changes: 3 additions & 0 deletions man/toolEdgeTransportSA.Rd

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

4 changes: 3 additions & 1 deletion man/toolLoadInputs.Rd

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

0 comments on commit 616be95

Please sign in to comment.