Skip to content

Commit

Permalink
Merge pull request #12 from 0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q/dev/twid…
Browse files Browse the repository at this point in the history
…dle_FE_shares

Increase (decrease) Non-OECD Electricity (Solids) FE Shares in Other Industry/2060
  • Loading branch information
0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q authored Nov 22, 2024
2 parents 9280f3a + 2e0487b commit 2169899
Show file tree
Hide file tree
Showing 6 changed files with 54 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: '8599325045'
ValidationKey: '1002450'
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.4.2.9001
date-released: '2024-11-18'
version: 0.5.0
date-released: '2024-11-22'
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.4.2.9001
Date: 2024-11-18
Version: 0.5.0
Date: 2024-11-22
Authors@R: c(
person(given = "Falk", family = "Benke", email = "benke@pik-potsdam.de",
role = c("aut", "cre")),
Expand Down
44 changes: 44 additions & 0 deletions R/calcFeDemandIndustry.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#' Calculates FE demand in industry as REMIND variables
#'
#' @md
#' @param use_ODYM_RECC per-capita pathways for `SDP_xx` scenarios? (Defaults
#' to `FALSE`.)
#' @param last_empirical_year Last year for which empirical data is available.
Expand Down Expand Up @@ -1041,6 +1042,49 @@ calcFeDemandIndustry <- function(use_ODYM_RECC = FALSE,
ungroup() %>%
select(-"value")

### modify subsector FE share targets ----
# Default data with no modification will reduce the solids share of other
# industry in the Non-OECD region by ten percentage points, and increase the
# electricity share by as much. The changes are phased in over the time
# horizon of IEA ETP data (2025–60).
IEA_ETP_Ind_FE_shares_delta <- tribble(
~region, ~subsector, ~fety, ~share.delta,
'Non-OECD', 'otherInd', 'feel', 0.1,
'Non-OECD', 'otherInd', 'feso', -0.1)

# verify modification sums
IEA_ETP_Ind_FE_shares_delta %>%
group_by(.data$region, .data$subsector) %>%
summarise(share.delta.sum = sum(.data$share.delta), .groups = 'drop') %>%
verify(0 == .data$share.delta.sum) %>%
invisible()

IEA_ETP_Ind_FE_shares <- IEA_ETP_Ind_FE_shares %>%
left_join(
# expand modifications to phase in from 0 to full over the time horizon of
# IEA_ETP_Ind_FE_shares
IEA_ETP_Ind_FE_shares_delta %>%
left_join(
IEA_ETP_Ind_FE_shares %>%
select(-'share') %>%
filter(.data$year %in% range(.data$year)),

c('region', 'subsector', 'fety')
) %>%
mutate(share.delta = ifelse(min(.data$year) == .data$year,
0,
.data$share.delta)) %>%
interpolate_missing_periods(year = unique(IEA_ETP_Ind_FE_shares$year),
value = 'share.delta'),

c('region', 'subsector', 'fety', 'year'),

) %>%
replace_na(list(share.delta = 0)) %>%
# add share modifications
mutate(share = .data$share + .data$share.delta) %>%
select(-'share.delta')

### split feel shares and extend to SSP scenarios ----
IEA_ETP_Ind_FE_shares <- bind_rows(
# all pf that don't need splitting
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.4.2.9001**
R package **mrindustry**, version **0.5.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 <benke@pik-potsdam.de>

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.4.2.9001, <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.5.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.4.2.9001},
note = {R package version 0.5.0},
url = {https://github.com/pik-piam/mrindustry},
}
```
4 changes: 2 additions & 2 deletions man/calcFeDemandIndustry.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2169899

Please sign in to comment.