Skip to content

Commit

Permalink
Further adjustments to mrdrivers update: Switch from GDP/PopulationPa…
Browse files Browse the repository at this point in the history
…st to GDP/Population
  • Loading branch information
ricardarosemann committed Nov 18, 2024
1 parent f97f1f9 commit 0d90177
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '1523192'
ValidationKey: '1523420'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ message: If you use this software, please cite it using the metadata from this f
type: software
title: 'mredgebuildings: Prepare data to be used by the EDGE-Buildings model'
version: 0.7.6
date-released: '2024-11-15'
date-released: '2024-11-18'
abstract: Prepare data to be used by the EDGE-Buildings model.
authors:
- family-names: Hasse
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Type: Package
Package: mredgebuildings
Title: Prepare data to be used by the EDGE-Buildings model
Version: 0.7.6
Date: 2024-11-15
Date: 2024-11-18
Authors@R: c(
person("Robin", "Hasse", , "robin.hasse@pik-potsdam.de", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-1818-3186")),
Expand Down
5 changes: 4 additions & 1 deletion R/calcFEUEefficiencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ calcFEUEefficiencies <- function(gasBioEquality = TRUE) {
mutate(variable = eqEffs[gasVar][[1]]) %>%
separate("variable", into = c("enduse", "carrier"), sep = "\\.")

efficiencies <- rbind(efficiencies, bioEffs)
efficiencies <- rbind(
anti_join(efficiencies, bioEffs, by = c("region", "period", "enduse", "carrier", "scenario")),
bioEffs
)
}
}

Expand Down
10 changes: 7 additions & 3 deletions R/calcFloorspacePast.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,17 @@ calcFloorspacePast <- function() {
region = "IND")

# historic population
pop <- calcOutput("PopulationPast", aggregate = FALSE) %>%
pop <- calcOutput("Population", scenario = "SSP2", aggregate = FALSE) %>%
as.quitte() %>%
mutate(unit = "million cap")
filter(.data[["period"]] <= endOfHistory) %>%
mutate(unit = "million cap",
variable = gsub("pop_SSP2", "population", .data[["variable"]], fixed = TRUE))

# historic GDP per capita
gdppop <- calcOutput("GDPPast", aggregate = FALSE) %>% # nolint
gdppop <- calcOutput("GDP", scenario = "SSP2", average2020 = FALSE, aggregate = FALSE, unit = "constant 2005 Int$PPP") %>% # nolint
as.quitte() %>%
filter(.data[["period"]] <= endOfHistory) %>%
mutate(variable = gsub("gdp_SSP2", "gdp in constant 2005 Int$PPP", .data[["variable"]], fixed = TRUE)) %>%
rbind(pop) %>%
calc_addVariable(gdppop = "`gdp in constant 2005 Int$PPP` / `population`",
units = "USD2005/cap", only.new = TRUE) %>%
Expand Down
1 change: 0 additions & 1 deletion R/calcShareETP.R
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ calcShareETP <- function(subtype = c("enduse", "carrier"), feOnly = FALSE) {
as.magpie(spatial = 1) %>%
toolCountryFill(verbosity = 0)


regShare <- regShare %>%
as.magpie(spatial = 1) %>%
collapseDim() %>%
Expand Down

0 comments on commit 0d90177

Please sign in to comment.