Skip to content

Commit

Permalink
Merge pull request #263 from johannah-pik/Refactoring
Browse files Browse the repository at this point in the history
Refactoring
  • Loading branch information
johannah-pik authored Jul 14, 2024
2 parents 68df540 + d321b11 commit aa1e9b5
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '30114504'
ValidationKey: '30135934'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
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: 'edgeTransport: Prepare EDGE Transport Data for the REMIND model'
version: 1.5.12
date-released: '2024-07-13'
version: 1.5.13
date-released: '2024-07-14'
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
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: edgeTransport
Title: Prepare EDGE Transport Data for the REMIND model
Version: 1.5.12
Version: 1.5.13
Authors@R: c(
person("Johanna", "Hoppe", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0009-0004-6753-5090")),
Expand All @@ -17,7 +17,7 @@ Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.1
VignetteBuilder: knitr
Date: 2024-07-13
Date: 2024-07-14
Config/testthat/edition: 3
Imports:
rmndt,
Expand Down
2 changes: 1 addition & 1 deletion R/toolApplyScenSpecEnInt.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ toolApplyScenSpecEnInt <- function(enInt, scenParEnergyIntensity, policyStartYea
#If Baseline efficiency improvements outperform transportPolScen specific improvements after fadeOut year (when the adjusted ones stay contstant), keep the Baseline
enInt[!is.na(value.y), value := ifelse(value.x < value.y, value.x, value.y)][, c("value.x", "value.y") := NULL]

if (anyNA(enInt) == TRUE) {stop("NAs were introduced whilst applying the scenario specific energy intensity improvements. Please check toolApplyScenpecEnInt()")}
if (anyNA(enInt) == TRUE) {stop("NAs were introduced whilst applying the scenario specific energy intensity improvements. Please check toolApplyScenSpecEnInt()")}

return(enInt)
}
5 changes: 4 additions & 1 deletion R/toolEdgeTransportSA.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ toolEdgeTransportSA <- function(SSPscen,
#------------------------------------------------------

fleetVehiclesPerTech <- NULL
iterations <- 3
iterations <- 1

if (isAnalyticsReported) {
endogenousCostsIterations <- list()
Expand Down Expand Up @@ -214,6 +214,9 @@ toolEdgeTransportSA <- function(SSPscen,
# Save data
outputFolder <- file.path(outputFolder, paste0(format(Sys.time(), "%Y-%m-%d_%H.%M.%S"),
"-", SSPscen, "-", transportPolScen, "-", demScen))
demScen <- paste0("gdp_", demScen)
SSPscen <- paste0("gdp_", SSPscen)

outputRaw <- list(
SSPscen = SSPscen,
transportPolScen = transportPolScen,
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Prepare EDGE Transport Data for the REMIND model

R package **edgeTransport**, version **1.5.12**
R package **edgeTransport**, version **1.5.13**

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

Expand Down Expand Up @@ -46,7 +46,7 @@ In case of questions / problems please contact Johanna Hoppe <johanna.hoppe@pik-

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

Hoppe J, Dirnaichner A, Rottoli M, Muessel J (2024). _edgeTransport: Prepare EDGE Transport Data for the REMIND model_. R package version 1.5.12, <https://github.com/pik-piam/edgeTransport>.
Hoppe J, Dirnaichner A, Rottoli M, Muessel J (2024). _edgeTransport: Prepare EDGE Transport Data for the REMIND model_. R package version 1.5.13, <https://github.com/pik-piam/edgeTransport>.

A BibTeX entry for LaTeX users is

Expand All @@ -55,7 +55,7 @@ A BibTeX entry for LaTeX users is
title = {edgeTransport: Prepare EDGE Transport Data for the REMIND model},
author = {Johanna Hoppe and Alois Dirnaichner and Marianna Rottoli and Jarusch Muessel},
year = {2024},
note = {R package version 1.5.12},
note = {R package version 1.5.13},
url = {https://github.com/pik-piam/edgeTransport},
}
```

0 comments on commit aa1e9b5

Please sign in to comment.