Skip to content

Commit

Permalink
Merge pull request #17 from 0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q/dev/regi…
Browse files Browse the repository at this point in the history
…_diff_feh2_shares

regionally differentiated convergence of feh2 share in fega
  • Loading branch information
0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q authored Dec 3, 2024
2 parents 3a09682 + 7ae82dc commit b228995
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '1403920'
ValidationKey: '1604800'
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: 'mrindustry: input data generation for the REMIND industry module'
version: 0.7.0
date-released: '2024-11-29'
version: 0.8.0
date-released: '2024-12-03'
abstract: The mrindustry packages contains data preprocessing for the REMIND model.
authors:
- family-names: Benke
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: mrindustry
Title: input data generation for the REMIND industry module
Version: 0.7.0
Date: 2024-11-29
Version: 0.8.0
Date: 2024-12-03
Authors@R: c(
person(given = "Falk", family = "Benke", email = "[email protected]",
role = c("aut", "cre")),
Expand Down
32 changes: 26 additions & 6 deletions R/calcFeDemandIndustry.R
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,6 @@ calcFeDemandIndustry <- function(use_ODYM_RECC = FALSE,
}

### extend to H2 and HTH_el shares ----
feh2_share_in_fega <- 0.35
# H2 shares grow linearly from 0.1 % to feh2_share_in_fega of fega from
# 2025 to 2060 and are constant afterwards
industry_subsectors_en_shares <- bind_rows(
Expand All @@ -1272,12 +1271,33 @@ calcFeDemandIndustry <- function(use_ODYM_RECC = FALSE,
complete(nesting(!!!syms(setdiff(colnames(.), "pf.fety"))),
pf.fety = c("fega", "feh2")) %>%
pivot_wider(names_from = "pf.fety", values_from = "share") %>%
mutate(feh2 = pmin(feh2_share_in_fega,
pmax(0.01,
feh2_share_in_fega
* (.data$year - 2025) / (2060 - 2025)))
full_join(
bind_rows(
expand_grid(
region = c('CAZ', 'CHA', 'DEU', 'ECE', 'ECS', 'ENC', 'ESC', 'ESW',
'EWN', 'FRA', 'JPN', 'UKI', 'USA'),
year.start = 2025,
year.end = 2060,
feh2_share_in_fega = 0.35),

expand_grid(
region = c('IND', 'LAM', 'MEA', 'NEN', 'NES', 'OAS', 'REF', 'SSA'),
year.start = 2030,
year.end = 2060,
feh2_share_in_fega = 0.35)
),

'region') %>%
assert(not_na, everything()) %>%
mutate(
feh2 = pmin(.data$feh2_share_in_fega,
pmax(0.01,
.data$feh2_share_in_fega
* (.data$year - .data$year.start)
/ (.data$year.end - .data$year.start)))
* .data$fega,
fega = .data$fega - .data$feh2) %>%
fega = .data$fega - .data$feh2) %>%
select(-'year.start', -'year.end', -'feh2_share_in_fega') %>%
pivot_longer(c("fega", "feh2"), names_to = "pf.fety",
values_to = "share") %>%
unite("pf", c("pf.fety", "pf.subsector"), sep = "_")
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 REMIND industry module

R package **mrindustry**, version **0.7.0**
R package **mrindustry**, version **0.8.0**

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

Expand Down Expand Up @@ -39,7 +39,7 @@ In case of questions / problems please contact Falk Benke <[email protected]>

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

Benke F, Dürrwächter J, Rodrigues R, Moreno-Leiva S, Baumstark L, Pehl M (2024). _mrindustry: input data generation for the REMIND industry module_. R package version 0.7.0, <https://github.com/pik-piam/mrindustry>.
Benke F, Dürrwächter J, Rodrigues R, Moreno-Leiva S, Baumstark L, Pehl M (2024). _mrindustry: input data generation for the REMIND industry module_. R package version 0.8.0, <https://github.com/pik-piam/mrindustry>.

A BibTeX entry for LaTeX users is

Expand All @@ -48,7 +48,7 @@ A BibTeX entry for LaTeX users is
title = {mrindustry: input data generation for the REMIND industry module},
author = {Falk Benke and Jakob Dürrwächter and Renato Rodrigues and Simón Moreno-Leiva and Lavinia Baumstark and Michaja Pehl},
year = {2024},
note = {R package version 0.7.0},
note = {R package version 0.8.0},
url = {https://github.com/pik-piam/mrindustry},
}
```

0 comments on commit b228995

Please sign in to comment.