Skip to content

Commit

Permalink
Merge pull request #23 from ahagen-pik/main
Browse files Browse the repository at this point in the history
fix GDP thresholds 2W and MER function calls
  • Loading branch information
ahagen-pik authored Oct 25, 2024
2 parents 4fc1f94 + ca6412b commit ebe843c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '1541463'
ValidationKey: '1561560'
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: 'mrtransport: Input data generation for the EDGE-Transport model'
version: 0.7.7
date-released: '2024-10-23'
version: 0.7.8
date-released: '2024-10-24'
abstract: The mrtransport package contains data preprocessing for the EDGE-Transport
model.
authors:
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: mrtransport
Title: Input data generation for the EDGE-Transport model
Version: 0.7.7
Version: 0.7.8
Authors@R: c(
person("Johanna", "Hoppe", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0009-0004-6753-5090")),
Expand All @@ -26,4 +26,4 @@ Imports:
magrittr,
quitte,
data.table
Date: 2024-10-23
Date: 2024-10-24
4 changes: 2 additions & 2 deletions R/calcEdgeTransportSAinputs.R
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ calcEdgeTransportSAinputs <- function(subtype, SSPscen = "SSP2EU", IEAharm = TRU
# PSI CAPEX for 4 Wheelers feature only purchase costs - take other capital costs from UCD for EUR regions
CAPEXraw <- rbind(PSIpurchaseCosts, CAPEXUCD4W, CAPEXcombinedUCD, data$operatingSubsidyUCD)

GDPpcMERmag <- calcOutput("GDPpc", aggregate = FALSE) |> time_interpolate(highResYears)
GDPpcMERmag <- calcOutput("GDPpc", aggregate = FALSE, unit = "constant 2017 US$MER") |> time_interpolate(highResYears)
GDPpcMERmag <- GDPpcMERmag[, , paste0("gdppc_", SSPscen)]

GDPpcMER <- magpie2dt(GDPpcMERmag, yearcol = "period", regioncol = "region", valcol = "gdppc")[, variable := NULL]
Expand Down Expand Up @@ -532,7 +532,7 @@ calcEdgeTransportSAinputs <- function(subtype, SSPscen = "SSP2EU", IEAharm = TRU
# merge.data.table data
CAPEXraw <- rbind(CAPEXUCD, data$CAPEXcombinedUCD, data$operatingSubsidyUCD)

GDPpcMERmag <- calcOutput("GDPpc", aggregate = FALSE) |> time_interpolate(lowResYears)
GDPpcMERmag <- calcOutput("GDPpc", aggregate = FALSE, unit = "constant 2017 US$MER") |> time_interpolate(lowResYears)
GDPpcMERmag <- GDPpcMERmag[, , paste0("gdppc_", SSPscen)]

GDPpcMER <- magpie2dt(GDPpcMERmag, yearcol = "period", regioncol = "region", valcol = "gdppc")[, variable := NULL]
Expand Down
6 changes: 4 additions & 2 deletions R/toolAdjustCAPEXother.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ toolAdjustCAPEXother <- function(dt, ISOcountries, yrs, completeData, GDPpcMER,
dt[, check := NULL]

#5: Lower the prices for LDW 2 Wheelers depending on the GDP to represent a 2nd hand vehicle market
minGDP <- 4000 ## minimum GDPcap after which the linear trend starts
maxGDP <- 30000 ## maximum GDPcap marking the level where no factor is implemented
convfact <- convertSingle(x = 1, iso3c = "USA", unit_in = "constant 2005 Int$PPP",
unit_out = mrdrivers::toolGetUnitDollar())
minGDP <- 4000 * convfact ## minimum GDPcap after which the linear trend starts
maxGDP <- 30000 * convfact ## maximum GDPcap marking the level where no factor is implemented
lowerBound <- 0.3 ## maximum decrease to be applied to the original costs value

GDPpcMER[, factor := ifelse(gdppc < maxGDP & gdppc > minGDP, (1 - lowerBound) /
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Input data generation for the EDGE-Transport model

R package **mrtransport**, version **0.7.7**
R package **mrtransport**, version **0.7.8**

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

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

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

Hoppe J, Muessel J, Dirnaichner A (2024). _mrtransport: Input data generation for the EDGE-Transport model_. R package version 0.7.7, <https://github.com/pik-piam/mrtransport>.
Hoppe J, Muessel J, Dirnaichner A (2024). _mrtransport: Input data generation for the EDGE-Transport model_. R package version 0.7.8, <https://github.com/pik-piam/mrtransport>.

A BibTeX entry for LaTeX users is

Expand All @@ -48,7 +48,7 @@ A BibTeX entry for LaTeX users is
title = {mrtransport: Input data generation for the EDGE-Transport model},
author = {Johanna Hoppe and Jarusch Muessel and Alois Dirnaichner},
year = {2024},
note = {R package version 0.7.7},
note = {R package version 0.7.8},
url = {https://github.com/pik-piam/mrtransport},
}
```

0 comments on commit ebe843c

Please sign in to comment.