Skip to content

Commit

Permalink
Merge pull request #20 from johannah-pik/main
Browse files Browse the repository at this point in the history
Bugfix unit shift
  • Loading branch information
johannah-pik authored Oct 21, 2024
2 parents 2e21468 + 56ea3b5 commit 0a88a69
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '1480518'
ValidationKey: '1501125'
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.4
date-released: '2024-10-11'
version: 0.7.5
date-released: '2024-10-19'
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.4
Version: 0.7.5
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-11
Date: 2024-10-19
2 changes: 1 addition & 1 deletion R/convertUCD.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ convertUCD <- function(x, subtype) {
x <- toolAggregate(x, rel = UCD2iso)

# convert US$2005 to US$20217
y <- GDPuc::toolConvertGDP(
x <- GDPuc::toolConvertGDP(
gdp = x,
unit_in = "constant 2005 US$MER",
unit_out = mrdrivers::toolGetUnitDollar(),
Expand Down
10 changes: 5 additions & 5 deletions R/toolAdjustCAPEXother.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ toolAdjustCAPEXother <- function(dt, ISOcountries, yrs, completeData, GDPpcMER,
h2Air <- dt[univocalName == "Domestic Aviation" & technology == "Liquids"][, technology := "Hydrogen"]
# CAPEX of hydrogen airplanes is assumed today 5 times more expensive than a conventional airplane
# (i.e. not present in the market)
h2Air[univocalName %in% "Domestic Aviation" & period <= 2020,
value := 5 * value]
h2Air[period <= 2020, value := 5 * value]
# for hydrogen airplanes, in between 2020 and 2040 the cost follows a linear trend,
# and reaches a value 30% higher than a liquids fuelled airplane
h2Air[univocalName == "Domestic Aviation" & period >= 2020,
value := ifelse(period <= 2040, value[period == 2020] + (1.3 * value[period == 2100] - value[period == 2020])
* (period - 2020) / (2100 - 2020), 1.3 * value[period == 2100])]
h2Air[period >= 2020,
value := ifelse(period <= 2040, value[period == 2020] - (value[period == 2020] - 1.3 * value[period == 2100])
* (period - 2020) / (2040 - 2020), value), by = c("region")]
h2Air[, value := ifelse(period > 2040, value[period == 2040], value), by = c("region")]
dt <- rbind(dt, h2Air)

#4: Some two wheeler classes are missing and are replaced by other vehicle classes
Expand Down
14 changes: 7 additions & 7 deletions R/toolAdjustNonFuelOPEXother.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ toolAdjustNonFuelOPEXother <- function(dt, ISOcountries, yrs, completeData, filt
h2Air <- dt[univocalName == "Domestic Aviation" & technology == "Liquids"][, technology := "Hydrogen"]
# following https://www.fch.europa.eu/sites/default/files/FCH%20Docs/20200507_Hydrogen%20Powered%20Aviation%20report_FINAL%20web%20%28ID%208706035%29.pdf # nolint: line_length_linter
# maintenance costs are 50% higher than than a liquids fuelled airplane
h2Air[univocalName == "Domestic Aviation" & period <= 2020,
value := 1.5 * value]
# for hydrogen airplanes, in between 2020 and 2040 the cost follows a linear trend, and reaches
# a value 30% higher than a liquids fuelled airplane
h2Air[univocalName == "Domestic Aviation" & period >= 2020,
value := ifelse(period <= 2040, value[period == 2020] + (1.3 * value[period == 2100] - value[period == 2020])
* (period - 2020) / (2100 - 2020), 1.3 * value[period == 2100])]
h2Air[period <= 2020, value := 1.5 * value]
# for hydrogen airplanes, in between 2020 and 2040 the cost follows a linear trend,
# and reaches a value 30% higher than a liquids fuelled airplane
h2Air[period >= 2020,
value := ifelse(period <= 2040, value[period == 2020] - (value[period == 2020] - 1.3 * value[period == 2100])
* (period - 2020) / (2040 - 2020), value), by = c("region")]
h2Air[, value := ifelse(period > 2040, value[period == 2040], value), by = c("region")]
dt <- rbind(dt, h2Air)

#4: Some two wheeler classes are missing and are replaced by other vehicle classes
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.4**
R package **mrtransport**, version **0.7.5**

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

0 comments on commit 0a88a69

Please sign in to comment.