Skip to content

Commit

Permalink
fix GDP thresholds in adjustCAPEXtrackedFleet
Browse files Browse the repository at this point in the history
  • Loading branch information
johannah-pik committed Oct 23, 2024
1 parent 64e98c1 commit c874076
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
ValidationKey: '1521292'
ValidationKey: '1541463'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
- 'Warning: namespace ''.*'' is not available and has been replaced'
AcceptedNotes: 'Undefined global functions or variables:'
allowLinterWarnings: yes
enforceVersionUpdate: no
skipCoverage: no
2 changes: 1 addition & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ jobs:
shell: Rscript {0}
run: |
nonDummyTests <- setdiff(list.files("./tests/testthat/"), c("test-dummy.R", "_snaps"))
if(length(nonDummyTests) > 0) covr::codecov(quiet = FALSE)
if(length(nonDummyTests) > 0 && !lucode2:::loadBuildLibraryConfig()[["skipCoverage"]]) covr::codecov(quiet = FALSE)
env:
NOT_CRAN: "true"
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.6
date-released: '2024-10-21'
version: 0.7.7
date-released: '2024-10-23'
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.6
Version: 0.7.7
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-21
Date: 2024-10-23
9 changes: 6 additions & 3 deletions R/toolAdjustCAPEXtrackedFleet.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ toolAdjustCAPEXtrackedFleet <- function(dt, ISOcountries, yrs, completeData, GDP
variable <- value <- region <- regionCode12 <- period <-
technology <- univocalName <- markup <- univocalName <-
unit <- check <- gdppc <- . <- NULL

browser()
# 1: LDV 4 Wheeler adjustments
# 1a: Delete Capital costs other, as it is unclear what it represents
dt <- dt[!(univocalName %in% filter$trn_pass_road_LDV_4W & variable == "Capital costs (other)")]
Expand Down Expand Up @@ -268,8 +268,11 @@ toolAdjustCAPEXtrackedFleet <- function(dt, ISOcountries, yrs, completeData, GDP
dt <- rbind(dt[!(is.na(value) & univocalName %in% filter$trn_pass_road_LDV_4W)], missing4W)[, check := NULL]

# 5: Lower the prices for LDW 4 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,
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.6**
R package **mrtransport**, version **0.7.7**

[![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.6, <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.7, <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.6},
note = {R package version 0.7.7},
url = {https://github.com/pik-piam/mrtransport},
}
```

0 comments on commit c874076

Please sign in to comment.